Skip to content

Gaspero/kysely-ydb

Repository files navigation

kysely-ydb

Kysely dialects, plugins and other goodies for YDB

Disclaimer

This repo is currently WIP (Work in process) and thus is not production ready.

For now on, it only provides capabilities of basic select queries against YDB and does not support some dialect-specific expressions.

Types are mapped in accordance with @ydbjs/value implementation.

Installation

npm i kysely-ydb

Example usage

import { Driver } from '@ydbjs/core'
import { Kysely } from 'kysely'
import { YdbDialect } from 'kysely-ydb'

interface UserTable {
  id: string
  name?: string
  email?: string
  email_verified?: Date
  image?: string
}

interface Database {
  users: UserTable
}

const YDB_ENDPOINT = 'grpcs://localhost:2135/local'

const driver = new Driver(YDB_ENDPOINT)

const db = new Kysely<Database>({
  dialect: new YdbDialect({
    driver,
  }),
})

export async function run() {
  const results = await db.selectFrom('users').select(['id', 'email', 'email_verified']).execute()
  console.log(results)
}

run()

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors