also looking at this
fix(types): config options should not require what the library already defaults
#1064
12 files
+885
-117
| @@ -81,6 +81,27 @@ const q = db | ||
| 81 | 81 | const rows = await q.execute() |
| 82 | 82 | ``` |
| 83 | 83 | |
| 84 | ### Configuration | |
| 85 | ||
| 86 | Drop a `query-builder.config.ts` in your project root. Every field is optional at | |
| 87 | every depth — supply only what you want to change, and the library defaults the rest: | |
| 88 | ||
| 89 | ```ts | |
| 90 | import { defineConfig } from 'bun-query-builder' | |
| 91 | ||
| 92 | export default defineConfig({ | |
| 93 | dialect: 'postgres', | |
| 94 | database: { database: 'my_app' }, | |
| 95 | }) | |
| 96 | ``` | |
| 97 | ||
| 98 | ```ts | |
| 99 | // Load it once at app boot, or configure from code with setConfig(). | |
| 100 | import { getConfig } from 'bun-query-builder' | |
| 101 | ||
| 102 | await getConfig() | |
| 103 | ``` | |
| 104 | ||
| 84 | 105 | ### Aggregations |
| 85 | 106 | |
| 86 | 107 | ```ts |