@leonardovida-md/drizzle-neo-duckdb 1.1.4 → 1.2.0

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
@@ -280,9 +280,6 @@ const db = drizzle(connection, {
280
280
  // Pool size/preset when using connection strings (default: 4). Set false to disable.
281
281
  pool: { size: 8 },
282
282
 
283
- // Rewrite Postgres array operators to DuckDB functions (default: true)
284
- rewriteArrays: true,
285
-
286
283
  // Throw on Postgres-style array literals like '{1,2,3}' (default: false)
287
284
  rejectStringArrayLiterals: false,
288
285
 
@@ -291,6 +288,8 @@ const db = drizzle(connection, {
291
288
  });
292
289
  ```
293
290
 
291
+ Postgres array operators (`@>`, `<@`, `&&`) are automatically rewritten to DuckDB's `array_has_*` functions via AST transformation.
292
+
294
293
  ## Known Limitations
295
294
 
296
295
  This connector aims for compatibility with Drizzle's Postgres driver but has some differences:
package/dist/dialect.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { entityKind } from 'drizzle-orm/entity';
2
2
  import type { MigrationConfig, MigrationMeta } from 'drizzle-orm/migrator';
3
3
  import { PgDialect, PgSession } from 'drizzle-orm/pg-core';
4
- import { type DriverValueEncoder, type QueryTypingsValue } from 'drizzle-orm';
4
+ import { SQL, type DriverValueEncoder, type QueryTypingsValue } from 'drizzle-orm';
5
+ import type { QueryWithTypings } from 'drizzle-orm/sql/sql';
5
6
  export declare class DuckDBDialect extends PgDialect {
6
7
  static readonly [entityKind]: string;
7
8
  private hasPgJsonColumn;
@@ -29,4 +30,5 @@ export declare class DuckDBDialect extends PgDialect {
29
30
  markSavepointsUnsupported(): void;
30
31
  migrate(migrations: MigrationMeta[], session: PgSession, config: MigrationConfig | string): Promise<void>;
31
32
  prepareTyping(encoder: DriverValueEncoder<unknown, unknown>): QueryTypingsValue;
33
+ sqlToQuery(sqlObj: SQL, invokeSource?: 'indexes' | undefined): QueryWithTypings;
32
34
  }
package/dist/driver.d.ts CHANGED
@@ -12,10 +12,9 @@ import { DuckDBDialect } from './dialect.ts';
12
12
  import { DuckDBSelectBuilder } from './select-builder.ts';
13
13
  import type { ExecuteBatchesRawChunk, ExecuteInBatchesOptions, RowData } from './client.ts';
14
14
  import { type DuckDBPoolConfig, type PoolPreset } from './pool.ts';
15
- import { type PreparedStatementCacheConfig, type PrepareCacheOption, type RewriteArraysMode, type RewriteArraysOption } from './options.ts';
15
+ import { type PreparedStatementCacheConfig, type PrepareCacheOption } from './options.ts';
16
16
  export interface PgDriverOptions {
17
17
  logger?: Logger;
18
- rewriteArrays?: RewriteArraysMode;
19
18
  rejectStringArrayLiterals?: boolean;
20
19
  prepareCache?: PreparedStatementCacheConfig;
21
20
  }
@@ -35,7 +34,6 @@ export interface DuckDBConnectionConfig {
35
34
  options?: Record<string, string>;
36
35
  }
37
36
  export interface DuckDBDrizzleConfig<TSchema extends Record<string, unknown> = Record<string, never>> extends DrizzleConfig<TSchema> {
38
- rewriteArrays?: RewriteArraysOption;
39
37
  rejectStringArrayLiterals?: boolean;
40
38
  prepareCache?: PrepareCacheOption;
41
39
  /** Pool configuration. Use preset name, size config, or false to disable. */