@earth-app/collegedb 1.1.2 → 1.1.4

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/router.d.ts CHANGED
@@ -213,6 +213,10 @@ export declare function prepare(key: string, sql: string): Promise<PreparedState
213
213
  * The primary key is used to determine which shard should store the record,
214
214
  * ensuring consistent routing for future queries.
215
215
  *
216
+ * Use this helper when your application already knows the routing key before
217
+ * issuing the write. For database-generated primary keys, use {@link insert}
218
+ * so the returned generated id can be captured and reused for follow-up reads.
219
+ *
216
220
  * @template T - Type of the result records
217
221
  * @param key - Primary key to route the query (should match the record's primary key)
218
222
  * @param sql - SQL statement with parameter placeholders
@@ -271,6 +275,75 @@ export declare function prepare(key: string, sql: string): Promise<PreparedState
271
275
  * ```
272
276
  */
273
277
  export declare function run<T = Record<string, unknown>>(key: string, sql: string, bindings?: any[]): Promise<QueryResult<T>>;
278
+ /**
279
+ * Result returned by {@link insert} and {@link insertShard}.
280
+ *
281
+ * The helper keeps the normal query payload but also exposes the generated
282
+ * primary key when the backend returns one through `RETURNING` rows or
283
+ * provider metadata.
284
+ *
285
+ * @since 1.1.4
286
+ */
287
+ export interface InsertResult<T = Record<string, unknown>> extends QueryResult<T> {
288
+ /** Generated primary key returned by the database or driver. */
289
+ generatedId: number | string;
290
+ }
291
+ /**
292
+ * Executes an insert on an automatically selected shard and returns the generated primary key.
293
+ *
294
+ * This is the default helper for generated-key tables. CollegeDB picks a shard
295
+ * using the configured allocation strategy, then stores the generated primary
296
+ * key -> shard mapping so routed reads can find the row later.
297
+ *
298
+ * @template T - Type of returned rows when the insert uses `RETURNING`
299
+ * @param sql - The INSERT statement to execute
300
+ * @param bindings - Parameter values to bind to the statement
301
+ * @returns Promise resolving to the write result plus the generated id
302
+ * @throws {CollegeDBError} If the insert succeeds but no generated id can be determined
303
+ * @since 1.1.4
304
+ * @example
305
+ * ```typescript
306
+ * const created = await insert(
307
+ * 'INSERT INTO auto_users (name, email) VALUES (?, ?)',
308
+ * ['Ada', 'ada@example.com']
309
+ * );
310
+ *
311
+ * const row = await first(String(created.generatedId), 'SELECT * FROM auto_users WHERE id = ?', [created.generatedId]);
312
+ * ```
313
+ */
314
+ export declare function insert<T = Record<string, unknown>>(sql: string, bindings?: any[]): Promise<InsertResult<T>>;
315
+ /**
316
+ * Executes an insert directly on a named shard and returns the generated primary key.
317
+ *
318
+ * Use this helper when you already know the shard you want to target.
319
+ * The helper still captures the generated id and stores the mapping so routed
320
+ * reads can find the new row later.
321
+ *
322
+ * @template T - Type of returned rows when the insert uses `RETURNING`
323
+ * @param shardBinding - The shard binding to execute the insert on
324
+ * @param sql - The INSERT statement to execute
325
+ * @param bindings - Parameter values to bind to the statement
326
+ * @returns Promise resolving to the write result plus the generated id
327
+ * @throws {CollegeDBError} If the insert succeeds but no generated id can be determined
328
+ * @since 1.1.4
329
+ * @example
330
+ * ```typescript
331
+ * const created = await insertShard('db-east',
332
+ * 'INSERT INTO auto_users (name, email, created_at) VALUES (?, ?, ?)',
333
+ * ['Ada', 'ada@example.com', Date.now()]
334
+ * );
335
+ *
336
+ * console.log(created.generatedId);
337
+ * ```
338
+ * @example
339
+ * ```typescript
340
+ * const created = await insertShard('db-east',
341
+ * 'INSERT INTO auto_users (name, email) VALUES (?, ?) RETURNING id',
342
+ * ['Ada', 'ada@example.com']
343
+ * );
344
+ * ```
345
+ */
346
+ export declare function insertShard<T = Record<string, unknown>>(shardBinding: string, sql: string, bindings?: any[]): Promise<InsertResult<T>>;
274
347
  /**
275
348
  * Retrieves all records matching the query for a given primary key.
276
349
  *
@@ -335,6 +408,40 @@ export declare function all<T = Record<string, unknown>>(key: string, sql: strin
335
408
  * }
336
409
  */
337
410
  export declare function first<T = Record<string, unknown>>(key: string, sql: string, bindings?: any[]): Promise<T | null>;
411
+ /**
412
+ * Retrieves all records using a secondary lookup key when available.
413
+ *
414
+ * This helper attempts to resolve the lookup key through KV first. If a mapping
415
+ * exists, the query executes on that shard directly. If the mapping is missing,
416
+ * stale, or returns no rows, the helper safely falls back to fanout (`allAllShards`)
417
+ * and returns merged results.
418
+ *
419
+ * @template T - Type of the result records
420
+ * @param lookupKey - Secondary key such as `email:user@example.com` or `username:alice`
421
+ * @param sql - SQL statement to execute
422
+ * @param bindings - Parameter values to bind to the SQL statement
423
+ * @param batchSize - Number of concurrent shard queries during fanout (default: 50)
424
+ * @returns Promise resolving to merged query results
425
+ * @since 1.1.4
426
+ */
427
+ export declare function allByLookupKey<T = Record<string, unknown>>(lookupKey: string, sql: string, bindings?: any[], batchSize?: number): Promise<QueryResult<T>>;
428
+ /**
429
+ * Retrieves the first record using a secondary lookup key when available.
430
+ *
431
+ * This helper avoids creating new primary-key mappings for secondary identifiers.
432
+ * It first checks KV for a lookup-key mapping and queries that shard directly.
433
+ * If no mapping exists (or the mapping is stale), it falls back to fanout
434
+ * (`firstAllShards`) and returns the first non-null result.
435
+ *
436
+ * @template T - Type of the result record
437
+ * @param lookupKey - Secondary key such as `email:user@example.com` or `username:alice`
438
+ * @param sql - SQL statement to execute
439
+ * @param bindings - Parameter values to bind to the SQL statement
440
+ * @param batchSize - Number of concurrent shard queries during fanout (default: 50)
441
+ * @returns Promise resolving to the first matching record, or null
442
+ * @since 1.1.4
443
+ */
444
+ export declare function firstByLookupKey<T = Record<string, unknown>>(lookupKey: string, sql: string, bindings?: any[], batchSize?: number): Promise<T | null>;
338
445
  /**
339
446
  * Reassigns a primary key to a different shard
340
447
  *
@@ -536,6 +643,40 @@ export declare function runAllShards<T = Record<string, unknown>>(sql: string, b
536
643
  * @since 1.0.4
537
644
  */
538
645
  export declare function allAllShards<T = Record<string, unknown>>(sql: string, bindings?: any[], batchSize?: number): Promise<QueryResult<T>[]>;
646
+ /**
647
+ * Options for global all-shards merge/sort/pagination.
648
+ * @since 1.1.4
649
+ */
650
+ export interface GlobalAllShardsOptions<T = Record<string, unknown>> {
651
+ /** Number of concurrent shard queries to run at once (default: 50). */
652
+ batchSize?: number;
653
+ /** Number of rows to skip after global merge/sort (default: 0). */
654
+ offset?: number;
655
+ /** Maximum rows to return after global merge/sort. */
656
+ limit?: number;
657
+ /** Field name or selector used for global sorting. */
658
+ sortBy?: keyof T | ((row: T) => unknown);
659
+ /** Sort direction for `sortBy` (default: `asc`). */
660
+ sortDirection?: 'asc' | 'desc';
661
+ /** Optional custom comparator; takes precedence over `sortBy`. */
662
+ comparator?: (left: T, right: T) => number;
663
+ /** Optional global row filter applied before sort/paginate. */
664
+ filter?: (row: T) => boolean;
665
+ }
666
+ /**
667
+ * Executes a query on all shards and applies global merge/sort/pagination in-library.
668
+ *
669
+ * Unlike `allAllShards`, this helper returns a single merged `QueryResult` and can
670
+ * sort/paginate across the full combined result set after fanout.
671
+ *
672
+ * @template T - Type of the result records
673
+ * @param sql - SQL statement to execute on each shard
674
+ * @param bindings - Parameter values to bind to the SQL statement
675
+ * @param options - Global merge/sort/pagination options
676
+ * @returns Promise resolving to one globally-processed query result
677
+ * @since 1.1.4
678
+ */
679
+ export declare function allAllShardsGlobal<T = Record<string, unknown>>(sql: string, bindings?: any[], options?: GlobalAllShardsOptions<T>): Promise<QueryResult<T>>;
539
680
  /**
540
681
  * Executes a query on all shards and returns the first matching record from each shard.
541
682
  *
@@ -549,6 +690,18 @@ export declare function allAllShards<T = Record<string, unknown>>(sql: string, b
549
690
  * @since 1.0.4
550
691
  */
551
692
  export declare function firstAllShards<T = Record<string, unknown>>(sql: string, bindings?: any[], batchSize?: number): Promise<(T | null)[]>;
693
+ /**
694
+ * Executes a query on all shards with global merge/sort/pagination and returns
695
+ * the first row after global processing.
696
+ *
697
+ * @template T - Type of the result record
698
+ * @param sql - SQL statement to execute on each shard
699
+ * @param bindings - Parameter values to bind to the SQL statement
700
+ * @param options - Global merge/sort/pagination options (batchSize, sort, offset)
701
+ * @returns Promise resolving to the first globally-processed row, or null
702
+ * @since 1.1.4
703
+ */
704
+ export declare function firstAllShardsGlobal<T = Record<string, unknown>>(sql: string, bindings?: any[], options?: Omit<GlobalAllShardsOptions<T>, 'limit'>): Promise<T | null>;
552
705
  /**
553
706
  * Flushes all shard mappings (development only)
554
707
  *
@@ -595,4 +748,182 @@ export declare function flush(): Promise<void>;
595
748
  * ```
596
749
  */
597
750
  export declare function getDatabaseSizeForShard(shardBinding: string): Promise<number>;
751
+ /**
752
+ * Column specification for index creation helpers.
753
+ * @since 1.1.4
754
+ */
755
+ export interface IndexColumnDefinition {
756
+ /** Column name to include in the index. */
757
+ name: string;
758
+ /** Optional sort direction for this column. */
759
+ order?: 'ASC' | 'DESC';
760
+ /** Optional collation (e.g., NOCASE). */
761
+ collate?: string;
762
+ }
763
+ /**
764
+ * Options for index creation helpers.
765
+ * @since 1.1.4
766
+ */
767
+ export interface CreateIndexOptions {
768
+ /** Explicit index name. When omitted, a deterministic name is generated. */
769
+ indexName?: string;
770
+ /** Create a unique index. */
771
+ unique?: boolean;
772
+ /** Include `IF NOT EXISTS` in generated SQL. @default true */
773
+ ifNotExists?: boolean;
774
+ /** Optional partial-index predicate (trusted SQL only). */
775
+ where?: string;
776
+ /** Number of concurrent shard operations for all-shard variants. @default 50 */
777
+ batchSize?: number;
778
+ }
779
+ /**
780
+ * Creates an index on the shard resolved by the provided key.
781
+ *
782
+ * @param key - Primary key used for shard routing
783
+ * @param table - Target table name
784
+ * @param columns - One or more columns to index
785
+ * @param options - Index creation options
786
+ * @returns Query result for the DDL statement
787
+ * @since 1.1.4
788
+ */
789
+ export declare function index<T = Record<string, unknown>>(key: string, table: string, columns: string | string[] | IndexColumnDefinition[], options?: Omit<CreateIndexOptions, 'batchSize'>): Promise<QueryResult<T>>;
790
+ /**
791
+ * Creates an index directly on a specific shard.
792
+ *
793
+ * @param shardBinding - Shard binding name
794
+ * @param table - Target table name
795
+ * @param columns - One or more columns to index
796
+ * @param options - Index creation options
797
+ * @returns Query result for the DDL statement
798
+ * @since 1.1.4
799
+ */
800
+ export declare function indexShard<T = Record<string, unknown>>(shardBinding: string, table: string, columns: string | string[] | IndexColumnDefinition[], options?: Omit<CreateIndexOptions, 'batchSize'>): Promise<QueryResult<T>>;
801
+ /**
802
+ * Creates an index across all configured shards.
803
+ *
804
+ * @param table - Target table name
805
+ * @param columns - One or more columns to index
806
+ * @param options - Index creation options, including `batchSize`
807
+ * @returns Per-shard query results
808
+ * @since 1.1.4
809
+ */
810
+ export declare function indexAllShards<T = Record<string, unknown>>(table: string, columns: string | string[] | IndexColumnDefinition[], options?: CreateIndexOptions): Promise<QueryResult<T>[]>;
811
+ /**
812
+ * Explain helpers options.
813
+ * @since 1.1.4
814
+ */
815
+ export interface ExplainOptions {
816
+ /** Explain mode. @default query-plan */
817
+ mode?: 'query-plan' | 'raw' | 'analyze';
818
+ /** Number of concurrent shard operations for all-shard variants. @default 50 */
819
+ batchSize?: number;
820
+ }
821
+ /**
822
+ * Executes an explain query on the shard resolved by key.
823
+ *
824
+ * @param key - Primary key used for shard routing
825
+ * @param sql - SQL statement to inspect
826
+ * @param bindings - Parameter values for the SQL statement
827
+ * @param options - Explain mode options
828
+ * @returns Explain rows as a QueryResult
829
+ * @since 1.1.4
830
+ */
831
+ export declare function explain<T = Record<string, unknown>>(key: string, sql: string, bindings?: any[], options?: Omit<ExplainOptions, 'batchSize'>): Promise<QueryResult<T>>;
832
+ /**
833
+ * Executes an explain query on a specific shard.
834
+ *
835
+ * @param shardBinding - Shard binding name
836
+ * @param sql - SQL statement to inspect
837
+ * @param bindings - Parameter values for the SQL statement
838
+ * @param options - Explain mode options
839
+ * @returns Explain rows as a QueryResult
840
+ * @since 1.1.4
841
+ */
842
+ export declare function explainShard<T = Record<string, unknown>>(shardBinding: string, sql: string, bindings?: any[], options?: Omit<ExplainOptions, 'batchSize'>): Promise<QueryResult<T>>;
843
+ /**
844
+ * Executes an explain query across all shards.
845
+ *
846
+ * @param sql - SQL statement to inspect
847
+ * @param bindings - Parameter values for the SQL statement
848
+ * @param options - Explain options, including `batchSize`
849
+ * @returns Per-shard explain query results
850
+ * @since 1.1.4
851
+ */
852
+ export declare function explainAllShards<T = Record<string, unknown>>(sql: string, bindings?: any[], options?: ExplainOptions): Promise<QueryResult<T>[]>;
853
+ /**
854
+ * Table row-count result for a shard.
855
+ * @since 1.1.4
856
+ */
857
+ export interface ShardTableCount {
858
+ shard: string;
859
+ count: number | null;
860
+ success: boolean;
861
+ error?: string;
862
+ }
863
+ /**
864
+ * Counts rows for a table on the shard resolved by key.
865
+ *
866
+ * @param key - Primary key used for shard routing
867
+ * @param table - Table name to count
868
+ * @returns Row count for that routed shard
869
+ * @since 1.1.4
870
+ */
871
+ export declare function count(key: string, table: string): Promise<number>;
872
+ /**
873
+ * Counts rows for a table on a specific shard.
874
+ *
875
+ * @param shardBinding - Shard binding name
876
+ * @param table - Table name to count
877
+ * @returns Row count for the shard
878
+ * @since 1.1.4
879
+ */
880
+ export declare function countShard(shardBinding: string, table: string): Promise<number>;
881
+ /**
882
+ * Counts rows for a table across all shards.
883
+ *
884
+ * @param table - Table name to count
885
+ * @param batchSize - Number of concurrent shard queries (default: 50)
886
+ * @returns Per-shard counts and global total
887
+ * @since 1.1.4
888
+ */
889
+ export declare function countAllShards(table: string, batchSize?: number): Promise<{
890
+ total: number;
891
+ shards: ShardTableCount[];
892
+ }>;
893
+ /**
894
+ * Size information for a shard.
895
+ * @since 1.1.4
896
+ */
897
+ export interface ShardSizeResult {
898
+ shard: string;
899
+ size: number | null;
900
+ success: boolean;
901
+ error?: string;
902
+ }
903
+ /**
904
+ * Gets the size in bytes for the shard resolved by key.
905
+ *
906
+ * @param key - Primary key used for shard routing
907
+ * @returns Database size in bytes
908
+ * @since 1.1.4
909
+ */
910
+ export declare function getDatabaseSizeForKey(key: string): Promise<number>;
911
+ /**
912
+ * Gets database sizes for all shards.
913
+ *
914
+ * @param batchSize - Number of concurrent shard queries (default: 50)
915
+ * @returns Per-shard size results with success/error status
916
+ * @since 1.1.4
917
+ */
918
+ export declare function getDatabaseSizesAllShards(batchSize?: number): Promise<ShardSizeResult[]>;
919
+ /**
920
+ * Gets the combined size in bytes across all shards.
921
+ *
922
+ * Failed shard size checks are excluded from the sum.
923
+ *
924
+ * @param batchSize - Number of concurrent shard queries (default: 50)
925
+ * @returns Total size in bytes across successfully measured shards
926
+ * @since 1.1.4
927
+ */
928
+ export declare function getTotalDatabaseSize(batchSize?: number): Promise<number>;
598
929
  //# sourceMappingURL=router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,KAAK,EACX,eAAe,EACf,QAAQ,EAER,iBAAiB,EACjB,WAAW,EACX,WAAW,EAEX,UAAU,EAEV,MAAM,SAAS,CAAC;AA6CjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,eAAe,QA0BjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,eAAe,iBAuB5D;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAC,cAG5E;AA8DD;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAIlC;AAkGD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,CAkIjE;AAkVD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,YAAY,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGjF;AAED;;;;;;;GAOG;AACH,wBAAsB,OAAO,CAAC,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AG,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAUxE;AAED;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAAC,SAAS,GAAE,MAAW,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAmClG;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,SAAS,GAAE,MAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAGlF"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
7
- "version": "1.1.2",
7
+ "version": "1.1.4",
8
8
  "files": [
9
9
  "dist/**/*",
10
10
  "README.md",
@@ -46,24 +46,24 @@
46
46
  "devDependencies": {
47
47
  "@babel/cli": "^7.28.6",
48
48
  "@babel/core": "^7.29.0",
49
- "@babel/preset-env": "^7.29.2",
49
+ "@babel/preset-env": "^7.29.5",
50
50
  "@babel/preset-typescript": "^7.28.5",
51
- "@cloudflare/workers-types": "^4.20260418.1",
51
+ "@cloudflare/workers-types": "^4.20260509.1",
52
52
  "@types/bun": "latest",
53
53
  "@types/pg": "^8.20.0",
54
- "@vitest/coverage-v8": "^4.1.4",
54
+ "@vitest/coverage-v8": "^4.1.5",
55
55
  "drizzle-orm": "^0.45.2",
56
56
  "husky": "^9.1.7",
57
57
  "jsdoc-babel": "^0.5.0",
58
58
  "lint-staged": "^16.4.0",
59
- "mysql2": "^3.22.1",
59
+ "mysql2": "^3.22.3",
60
60
  "pg": "^8.20.0",
61
61
  "prettier": "^3.8.3",
62
62
  "prettier-plugin-organize-imports": "4.3.0",
63
63
  "redis": "^5.12.1",
64
64
  "typedoc": "^0.28.19",
65
- "vitest": "^4.1.4",
66
- "wrangler": "^4.83.0"
65
+ "vitest": "^4.1.5",
66
+ "wrangler": "^4.90.0"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "typescript": "^5.8.3"