![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@shiyuhang0/serverless
Advanced tools
This driver is for serverless and edge compute platforms that require HTTP external connections, such as Vercel Edge Functions or Cloudflare Workers.
Install
You can install the driver with npm:
npm install @tidbcloud/serverless
Query
To query from TiDB Serverless, you need to create a connection first. Then you can use the connection to execute raw SQL queries. For example:
import { connect } from '@tidbcloud/serverless'
const conn = connect({url: 'mysql://username:password@host/database'})
const results = await conn.execute('select * from test where id = ?',[1])
Transaction (Experimental)
You can also perform interactive transactions with the serverless driver. For example:
import { connect } from '@tidbcloud/serverless'
const conn = connect({url: 'mysql://username:password@host/database'})
const tx = await conn.begin()
try {
await tx.execute('insert into test values (1)')
await tx.execute('select * from test')
await tx.commit()
}catch (err) {
await tx.rollback()
throw err
}
Edge example
The serverless driver is suitable for the edge environments. See how to use it with Vercel Edge Functions:
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
import { connect } from '@tidbcloud/serverless'
export const runtime = 'edge'
export async function GET(request: NextRequest) {
const conn = connect({url: process.env.DATABASE_URL})
const result = await conn.execute('show tables')
return NextResponse.json({result});
}
See TiDB Cloud Serverless Driver documentation to learn more.
See Configure TiDB Cloud Serverless Driver.
Apache 2.0, see LICENSE.
FAQs
TiDB Cloud Serverless Driver
We found that @shiyuhang0/serverless demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.