@stacksjs/query-builder 0.58.48 → 0.58.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/query-builder",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "The Stacks Query Builder integration",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -36,7 +36,8 @@
36
36
  ],
37
37
  "files": [
38
38
  "README.md",
39
- "dist"
39
+ "dist",
40
+ "src"
40
41
  ],
41
42
  "scripts": {
42
43
  "build": "bun --bun build.ts",
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './kysely'
package/src/kysely.ts ADDED
@@ -0,0 +1,38 @@
1
+ import { Kysely, MysqlDialect as qbMysqlDialect, PostgresDialect as qbPostgresql, sql as qbSql } from 'kysely'
2
+ import type { Pool } from 'mysql2'
3
+ import { createPool } from 'mysql2'
4
+
5
+ // import { Pool } from 'pg'
6
+ // import { Cursor as qbCursor } from 'pg-cursor'
7
+
8
+ interface MysqlConfig {
9
+ driver?: string
10
+ url?: string
11
+ host?: string
12
+ port?: number
13
+ database?: string
14
+ user?: string
15
+ password?: string
16
+ }
17
+
18
+ // interface PostgresqlConfig {
19
+ // host?: string
20
+ // database?: string
21
+ // }
22
+ // export const Cursor = qbCursor
23
+
24
+ export const sql = qbSql
25
+
26
+ export const QueryBuilder = Kysely
27
+
28
+ export const MysqlDialect = qbMysqlDialect
29
+
30
+ export const PostgresDialect = qbPostgresql
31
+
32
+ // export function createPostgresPool(config: PostgresqlConfig) {
33
+ // return Pool(config)
34
+ // }
35
+
36
+ export function createMysqlPool(config: MysqlConfig): Pool {
37
+ return createPool(config)
38
+ }