Skip to main content
Module

x/kysely_deno_postgres_dialect/mod.ts>kysely.MysqlDialect

Kysely dialect for PostgreSQL using the deno-postgres client.
Latest
class kysely.MysqlDialect
implements Dialect
import { kysely } from "https://deno.land/x/kysely_deno_postgres_dialect@v0.27.1/mod.ts";
const { MysqlDialect } = kysely;

MySQL dialect that uses the mysql2 library.

The constructor takes an instance of MysqlDialectConfig.

import { createPool } from 'mysql2'

new MysqlDialect({
  pool: createPool({
    database: 'some_db',
    host: 'localhost',
  })
})

If you want the pool to only be created once it's first used, pool can be a function:

import { createPool } from 'mysql2'

new MysqlDialect({
  pool: async () => createPool({
    database: 'some_db',
    host: 'localhost',
  })
})

Constructors

new
MysqlDialect(config: MysqlDialectConfig)

Methods

Creates an adapter for the dialect.

Creates a driver for the dialect.

Creates a database introspector that can be used to get database metadata such as the table names and column names of those tables.

db never has any plugins installed. It's created using Kysely.withoutPlugins.

Creates a query compiler for the dialect.