bun-query-builder 0.2.24 → 0.2.26

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/README.md CHANGED
@@ -33,7 +33,7 @@ await QueryBuilder
33
33
 
34
34
  // Update
35
35
  await QueryBuilder
36
- .update('users')
36
+ .updateTable('users')
37
37
  .set({ active: false })
38
38
  .where('id', '=', 1)
39
39
  .execute()
@@ -45,6 +45,30 @@ await QueryBuilder
45
45
  .execute()
46
46
  ```
47
47
 
48
+ ## Configuration
49
+
50
+ Drop a `query-builder.config.ts` in your project root. Every field is optional at
51
+ every depth — supply only what you want to change, and the library defaults the rest:
52
+
53
+ ```typescript
54
+ import { defineConfig } from 'bun-query-builder'
55
+
56
+ export default defineConfig({
57
+ dialect: 'postgres',
58
+ database: { database: 'my_app' },
59
+ })
60
+ ```
61
+
62
+ ```typescript
63
+ // Load it once at app boot, or configure from code with setConfig().
64
+ import { getConfig } from 'bun-query-builder'
65
+
66
+ await getConfig()
67
+ ```
68
+
69
+ Type your own configuration against `QueryBuilderOptions` (what you write, everything
70
+ optional), not `QueryBuilderConfig` (what the library reads back, everything present).
71
+
48
72
  ## Features
49
73
 
50
74
  - **Typed from Models** - Infer tables, columns, and primary keys from your model files
@@ -24,8 +24,6 @@ export declare function saveMigrationSnapshot(plan: MigrationPlan, options?: { d
24
24
  * Simply update your models and run migrations - the system automatically figures out what changed.
25
25
  */
26
26
  export declare function generateMigration(dir?: string, opts?: MigrateOptions): Promise<GenerateMigrationResult>;
27
- // `dir` is the models directory. This function runs the SQL corpus, which it
28
- // finds from the workspace root, so it has no use for it — the parameter stays
29
27
  // because it is public API and every caller passes it.
30
28
  // eslint-disable-next-line pickier/no-unused-vars
31
29
  export declare function executeMigration(dir?: string): Promise<boolean>;