kysely
    Preparing search index...

    Class DummyDriver

    A driver that does absolutely nothing.

    You can use this to create Kysely instances solely for building queries

    This example creates a Kysely instance for building postgres queries:

    import {
    DummyDriver,
    Kysely,
    PostgresAdapter,
    PostgresIntrospector,
    PostgresQueryCompiler
    } from 'kysely'
    import type { Database } from 'type-editor' // imaginary module

    const db = new Kysely<Database>({
    dialect: {
    createAdapter: () => new PostgresAdapter(),
    createDriver: () => new DummyDriver(),
    createIntrospector: (db: Kysely<any>) => new PostgresIntrospector(db),
    createQueryCompiler: () => new PostgresQueryCompiler(),
    },
    })

    You can use it to build a query and compile it to SQL but trying to execute the query will throw an error.

    const { sql } = db.selectFrom('person').selectAll().compile()
    console.log(sql) // select * from "person"

    Implements

    Index

    Constructors

    Methods

    • Initializes the driver.

      After calling this method the driver should be usable and acquireConnection etc. methods should be callable.

      Returns Promise<void>