![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.
async-db-adapter
Advanced tools
Async database adapter for Javascript(& Typescript).
npm install async-db-adapter --save
You can create as follows:
(Please refer to the Config section for config.)
const connection = require("async-db-adapter").create({
adapter: "mysql"
/* config */
})
// or import {create} from "async-db-adapter"
// create(/* ... */)
npm install mysql --save
)npm install mysql2 --save
)npm install pg --save
)npm install sqlite3 --save
)Use adapter
, pool
parameter of create
function`s config
const connection = create({
adapter: "mysql",
...mysqlConfig,
}) // return instanceof MysqlConnection
const connection = create({
adapter: "mysql",
pool: true,
...mysqlConfig,
}) // return instanceof MysqlPool
const connection = create({
adapter: "mysql2",
...mysqlConfig,
}) // return instanceof Mysql2Connection
const connection = create({
adapter: "mysql2",
pool: true,
...mysqlConfig,
}) // return instanceof Mysql2Pool
const connection = create({
adapter: "pg",
...pgConfig,
}) // return instanceof PgConnection
const connection = create({
adapter: "pg",
pool: true,
...pgConfig,
}) // return instanceof PgPool
const connection = create({
adapter: "sqlite3",
filename: ":memory:",
}) // return instanceof Sqlite3Connection
const connections = create([
{
adapter: "mysql2",
pool: true,
...mysqlConfig,
},
{
adapter: "pg",
pool: true,
...pgConfig,
},
{
adapter: "sqlite3",
filename: ":memory:",
},
]) // return instanceof [MysqlPool, PgPool, Sqlite3Connection]
const connections = create({
default: {
adapter: "mysql2",
pool: true,
...mysqlConfig,
},
pg: {
adapter: "pg",
pool: true,
...pgConfig,
},
sqlite: {
adapter: "sqlite3",
filename: ":memory:",
},
}) // return instanceof {default: MysqlPool, pg: PgPool, sqlite: Sqlite3Connection}
All adapter objects inherit the following interfaces:
type TransactionHandler<P> = (connection: Connection) => Promise<P>|P
// mysql-pool, mysql2-pool, pg-pool
interface Pool extends Connection {
getConnection(): Promise<Connection>
}
// mysql, mysql2, pg, sqlite3
interface Connection {
close(): Promise<void>
query(query: string, values?: any): Promise<any>
select(query: string, values?: any): Promise<Row[]>
first(query: string, values?: any): Promise<Row|undefined>
transaction<P>(handler: TransactionHandler<P>): Promise<P>
}
Config can be defined as follows:
Use the connection option of the mysql
or mysql2
.
interface MysqlConnectionConfig extends MysqlBaseConfig {
readonly adapter: "mysql" | "mysql2"
readonly pool?: false
}
interface MysqlPoolConfig extends MysqlBaseConfig {
readonly adapter: "mysql" | "mysql2"
readonly pool: true
acquireTimeout?: number
waitForConnections?: boolean
connectionLimit?: number
queueLimit?: number
}
interface MysqlBaseConfig {
host?: string
port?: number
user?: string
password?: string
database?: string
charset?: string
timeout?: number
localAddress?: string
socketPath?: string
timezone?: string
connectTimeout?: number
stringifyObjects?: boolean
insecureAuth?: boolean
supportBigNumbers?: boolean
bigNumberStrings?: boolean
dateStrings?: boolean
trace?: boolean
multipleStatements?: boolean
flags?: string[]
queryFormat?(query: string, values: any): void
}
Use the connection option of the pg
.
interface PgConnectionConfig extends PgBaseConfig {
readonly adapter: "pg"
readonly pool?: false
}
interface PgPoolConfig extends PgBaseConfig {
readonly adapter: "pg"
readonly pool: true
max?: number
min?: number
connectionTimeoutMillis?: number
idleTimeoutMillis?: number
application_name?: string
Promise?: PromiseConstructorLike
}
interface PgBaseConfig {
ssl?: boolean | tls.TlsOptions
user?: string
database?: string
password?: string
port?: number
host?: string
connectionString?: string
keepAlive?: boolean
stream?: stream.Duplex
}
Use the connection option of the sqlite3
.
interface Sqlite3ConnectionConfig {
readonly adapter: "sqlite3"
readonly pool?: false
filename: string
mode?: number
}
MIT
FAQs
Async database adapter for Javascript(& Typescript).
The npm package async-db-adapter receives a total of 3 weekly downloads. As such, async-db-adapter popularity was classified as not popular.
We found that async-db-adapter 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.