bun-query-builder 0.1.33 → 0.1.34

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/dist/bin/cli.js CHANGED
@@ -11664,8 +11664,9 @@ async function getConfig() {
11664
11664
  alias: "qb",
11665
11665
  defaultConfig: defaultConfig4
11666
11666
  });
11667
+ setConfig(_config);
11667
11668
  }
11668
- return _config;
11669
+ return config5;
11669
11670
  }
11670
11671
  function setConfig(userConfig) {
11671
11672
  if (userConfig.dialect && _lastConfiguredDialect && userConfig.dialect !== _lastConfiguredDialect) {
@@ -30111,7 +30112,7 @@ function getPrefix() {
30111
30112
  }
30112
30113
  var prefix = getPrefix();
30113
30114
  // package.json
30114
- var version2 = "0.1.33";
30115
+ var version2 = "0.1.34";
30115
30116
 
30116
30117
  // bin/cli.ts
30117
30118
  init_actions();
package/dist/config.d.ts CHANGED
@@ -10,6 +10,26 @@ export declare function getPlaceholder(index: number): string;
10
10
  * MySQL/SQLite: ?, ?, ?
11
11
  */
12
12
  export declare function getPlaceholders(count: number, startIndex?: number): string;
13
+ /**
14
+ * Load the query-builder config from a config file (`query-builder.config.ts`,
15
+ * `.config/query-builder.ts`, etc.) and environment variables via bunfig, then
16
+ * MERGE it into the live, process-wide `config` singleton so every reader
17
+ * (dialect dispatch, placeholders, soft-deletes, the model layer, …) sees it.
18
+ *
19
+ * Call this once at application boot if you keep configuration in a file:
20
+ *
21
+ * ```ts
22
+ * import { getConfig } from 'bun-query-builder'
23
+ * await getConfig() // applies query-builder.config.ts + env to the runtime
24
+ * ```
25
+ *
26
+ * It is intentionally explicit/async: the builder otherwise runs purely off the
27
+ * synchronous `config` singleton (defaults + any `setConfig`), which keeps
28
+ * `bun --compile` and test behavior deterministic — auto-loading a file in the
29
+ * background would make early queries race the load. Previously this wrote the
30
+ * loaded config to a private `_config` variable that nothing else read, so a
31
+ * config file silently never took effect; it now routes through `setConfig`.
32
+ */
13
33
  export declare function getConfig(): Promise<QueryBuilderConfig>;
14
34
  export declare function setConfig(userConfig: Partial<QueryBuilderConfig>): void;
15
35
  export declare const defaultConfig: QueryBuilderConfig;
package/dist/src/index.js CHANGED
@@ -11664,8 +11664,9 @@ async function getConfig() {
11664
11664
  alias: "qb",
11665
11665
  defaultConfig: defaultConfig4
11666
11666
  });
11667
+ setConfig(_config);
11667
11668
  }
11668
- return _config;
11669
+ return config5;
11669
11670
  }
11670
11671
  function setConfig(userConfig) {
11671
11672
  if (userConfig.dialect && _lastConfiguredDialect && userConfig.dialect !== _lastConfiguredDialect) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-query-builder",
3
3
  "type": "module",
4
- "version": "0.1.33",
4
+ "version": "0.1.34",
5
5
  "description": "A simple yet performant query builder for TypeScript. Built with Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",