@polyglot-sql/sdk 0.2.0 → 0.2.2

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/index.d.cts CHANGED
@@ -313,6 +313,10 @@ declare type AlterTable = {
313
313
  * ClickHouse: ON CLUSTER clause for distributed DDL
314
314
  */
315
315
  on_cluster?: OnCluster | null;
316
+ /**
317
+ * Snowflake: ALTER ICEBERG TABLE
318
+ */
319
+ table_modifier?: string | null;
316
320
  };
317
321
 
318
322
  /**
@@ -2275,6 +2279,10 @@ declare type CreateFunction = {
2275
2279
  return_type: DataType | null;
2276
2280
  body: FunctionBody | null;
2277
2281
  or_replace: boolean;
2282
+ /**
2283
+ * TSQL: CREATE OR ALTER
2284
+ */
2285
+ or_alter?: boolean;
2278
2286
  if_not_exists: boolean;
2279
2287
  temporary: boolean;
2280
2288
  language: string | null;
@@ -2375,6 +2383,10 @@ declare type CreateProcedure = {
2375
2383
  parameters: Array<FunctionParameter>;
2376
2384
  body: FunctionBody | null;
2377
2385
  or_replace: boolean;
2386
+ /**
2387
+ * TSQL: CREATE OR ALTER
2388
+ */
2389
+ or_alter?: boolean;
2378
2390
  if_not_exists: boolean;
2379
2391
  language: string | null;
2380
2392
  security: FunctionSecurity | null;
@@ -2404,10 +2416,16 @@ declare type CreateProcedure = {
2404
2416
  * CREATE SCHEMA statement
2405
2417
  */
2406
2418
  declare type CreateSchema = {
2407
- name: Identifier;
2419
+ /**
2420
+ * Schema name parts, possibly dot-qualified (e.g. [mydb, hr] for "mydb.hr")
2421
+ */
2422
+ name: Array<Identifier>;
2408
2423
  if_not_exists: boolean;
2409
2424
  authorization: Identifier | null;
2410
- clone_from: Identifier | null;
2425
+ /**
2426
+ * CLONE source parts, possibly dot-qualified
2427
+ */
2428
+ clone_from: Array<Identifier> | null;
2411
2429
  /**
2412
2430
  * AT/BEFORE clause for time travel (Snowflake)
2413
2431
  */
@@ -2471,6 +2489,20 @@ declare type CreateSequence = {
2471
2489
  property_order: Array<SeqPropKind>;
2472
2490
  };
2473
2491
 
2492
+ /**
2493
+ * CREATE SYNONYM statement (TSQL)
2494
+ */
2495
+ declare type CreateSynonym = {
2496
+ /**
2497
+ * The synonym name (can be qualified: schema.synonym_name)
2498
+ */
2499
+ name: TableRef;
2500
+ /**
2501
+ * The target object the synonym refers to
2502
+ */
2503
+ target: TableRef;
2504
+ };
2505
+
2474
2506
  /**
2475
2507
  * CREATE TABLE statement
2476
2508
  */
@@ -2578,6 +2610,30 @@ declare type CreateTable = {
2578
2610
  * StarRocks: ROLLUP (r1(col1, col2), r2(col1))
2579
2611
  */
2580
2612
  rollup?: RollupProperty | null;
2613
+ /**
2614
+ * ClickHouse: UUID 'xxx' clause after table name
2615
+ */
2616
+ uuid?: string | null;
2617
+ };
2618
+
2619
+ /**
2620
+ * Snowflake CREATE TASK statement
2621
+ */
2622
+ declare type CreateTask = {
2623
+ or_replace: boolean;
2624
+ if_not_exists: boolean;
2625
+ /**
2626
+ * Task name (possibly qualified: db.schema.task)
2627
+ */
2628
+ name: string;
2629
+ /**
2630
+ * Raw text of properties between name and AS (WAREHOUSE, SCHEDULE, etc.)
2631
+ */
2632
+ properties: string;
2633
+ /**
2634
+ * The SQL statement body after AS
2635
+ */
2636
+ body: Expression;
2581
2637
  };
2582
2638
 
2583
2639
  /**
@@ -2596,6 +2652,10 @@ declare type CreateTrigger = {
2596
2652
  when_paren?: boolean;
2597
2653
  body: TriggerBody;
2598
2654
  or_replace: boolean;
2655
+ /**
2656
+ * TSQL: CREATE OR ALTER
2657
+ */
2658
+ or_alter?: boolean;
2599
2659
  constraint: boolean;
2600
2660
  deferrable: boolean | null;
2601
2661
  initially_deferred: boolean | null;
@@ -2619,6 +2679,10 @@ declare type CreateView = {
2619
2679
  columns: Array<ViewColumn>;
2620
2680
  query: Expression;
2621
2681
  or_replace: boolean;
2682
+ /**
2683
+ * TSQL: CREATE OR ALTER
2684
+ */
2685
+ or_alter?: boolean;
2622
2686
  if_not_exists: boolean;
2623
2687
  materialized: boolean;
2624
2688
  temporary: boolean;
@@ -3271,6 +3335,10 @@ export default _default;
3271
3335
  */
3272
3336
  declare type DefaultColumnConstraint = {
3273
3337
  this: Expression;
3338
+ /**
3339
+ * TSQL: DEFAULT value FOR column (table-level default constraint)
3340
+ */
3341
+ for_column?: Identifier | null;
3274
3342
  };
3275
3343
 
3276
3344
  /**
@@ -3741,6 +3809,14 @@ declare type DropTable = {
3741
3809
  * ClickHouse: SYNC modifier
3742
3810
  */
3743
3811
  sync: boolean;
3812
+ /**
3813
+ * Snowflake: DROP ICEBERG TABLE
3814
+ */
3815
+ iceberg: boolean;
3816
+ /**
3817
+ * RESTRICT modifier (opposite of CASCADE)
3818
+ */
3819
+ restrict: boolean;
3744
3820
  };
3745
3821
 
3746
3822
  /**
@@ -3994,6 +4070,10 @@ declare type ExecuteParameter = {
3994
4070
  * Whether this is a positional parameter (no = sign)
3995
4071
  */
3996
4072
  positional?: boolean;
4073
+ /**
4074
+ * TSQL OUTPUT modifier on parameter
4075
+ */
4076
+ output?: boolean;
3997
4077
  };
3998
4078
 
3999
4079
  /**
@@ -4009,6 +4089,10 @@ declare type ExecuteStatement = {
4009
4089
  * Named parameters: @param=value pairs
4010
4090
  */
4011
4091
  parameters: Array<ExecuteParameter>;
4092
+ /**
4093
+ * Trailing clause text (e.g. WITH RESULT SETS ((...)))
4094
+ */
4095
+ suffix?: string | null;
4012
4096
  };
4013
4097
 
4014
4098
  /**
@@ -4918,6 +5002,8 @@ declare type Expression = {
4918
5002
  "drop_procedure": DropProcedure;
4919
5003
  } | {
4920
5004
  "create_sequence": CreateSequence;
5005
+ } | {
5006
+ "create_synonym": CreateSynonym;
4921
5007
  } | {
4922
5008
  "drop_sequence": DropSequence;
4923
5009
  } | {
@@ -4940,6 +5026,8 @@ declare type Expression = {
4940
5026
  "kill": Kill;
4941
5027
  } | {
4942
5028
  "execute": ExecuteStatement;
5029
+ } | {
5030
+ "create_task": CreateTask;
4943
5031
  } | {
4944
5032
  "raw": Raw;
4945
5033
  } | {
@@ -6824,6 +6912,10 @@ declare type GrantPrincipal = {
6824
6912
  * Whether prefixed with GROUP keyword (Redshift)
6825
6913
  */
6826
6914
  is_group: boolean;
6915
+ /**
6916
+ * Whether prefixed with SHARE keyword (Snowflake)
6917
+ */
6918
+ is_share: boolean;
6827
6919
  };
6828
6920
 
6829
6921
  /**
@@ -12709,6 +12801,10 @@ declare type TableRef = {
12709
12801
  * Column aliases for table alias: AS t(c1, c2)
12710
12802
  */
12711
12803
  column_aliases: Array<Identifier>;
12804
+ /**
12805
+ * Leading comments that appeared before this table reference in a FROM clause
12806
+ */
12807
+ leading_comments?: Array<string>;
12712
12808
  /**
12713
12809
  * Trailing comments that appeared after this table reference
12714
12810
  */
package/dist/index.d.ts CHANGED
@@ -313,6 +313,10 @@ declare type AlterTable = {
313
313
  * ClickHouse: ON CLUSTER clause for distributed DDL
314
314
  */
315
315
  on_cluster?: OnCluster | null;
316
+ /**
317
+ * Snowflake: ALTER ICEBERG TABLE
318
+ */
319
+ table_modifier?: string | null;
316
320
  };
317
321
 
318
322
  /**
@@ -2275,6 +2279,10 @@ declare type CreateFunction = {
2275
2279
  return_type: DataType | null;
2276
2280
  body: FunctionBody | null;
2277
2281
  or_replace: boolean;
2282
+ /**
2283
+ * TSQL: CREATE OR ALTER
2284
+ */
2285
+ or_alter?: boolean;
2278
2286
  if_not_exists: boolean;
2279
2287
  temporary: boolean;
2280
2288
  language: string | null;
@@ -2375,6 +2383,10 @@ declare type CreateProcedure = {
2375
2383
  parameters: Array<FunctionParameter>;
2376
2384
  body: FunctionBody | null;
2377
2385
  or_replace: boolean;
2386
+ /**
2387
+ * TSQL: CREATE OR ALTER
2388
+ */
2389
+ or_alter?: boolean;
2378
2390
  if_not_exists: boolean;
2379
2391
  language: string | null;
2380
2392
  security: FunctionSecurity | null;
@@ -2404,10 +2416,16 @@ declare type CreateProcedure = {
2404
2416
  * CREATE SCHEMA statement
2405
2417
  */
2406
2418
  declare type CreateSchema = {
2407
- name: Identifier;
2419
+ /**
2420
+ * Schema name parts, possibly dot-qualified (e.g. [mydb, hr] for "mydb.hr")
2421
+ */
2422
+ name: Array<Identifier>;
2408
2423
  if_not_exists: boolean;
2409
2424
  authorization: Identifier | null;
2410
- clone_from: Identifier | null;
2425
+ /**
2426
+ * CLONE source parts, possibly dot-qualified
2427
+ */
2428
+ clone_from: Array<Identifier> | null;
2411
2429
  /**
2412
2430
  * AT/BEFORE clause for time travel (Snowflake)
2413
2431
  */
@@ -2471,6 +2489,20 @@ declare type CreateSequence = {
2471
2489
  property_order: Array<SeqPropKind>;
2472
2490
  };
2473
2491
 
2492
+ /**
2493
+ * CREATE SYNONYM statement (TSQL)
2494
+ */
2495
+ declare type CreateSynonym = {
2496
+ /**
2497
+ * The synonym name (can be qualified: schema.synonym_name)
2498
+ */
2499
+ name: TableRef;
2500
+ /**
2501
+ * The target object the synonym refers to
2502
+ */
2503
+ target: TableRef;
2504
+ };
2505
+
2474
2506
  /**
2475
2507
  * CREATE TABLE statement
2476
2508
  */
@@ -2578,6 +2610,30 @@ declare type CreateTable = {
2578
2610
  * StarRocks: ROLLUP (r1(col1, col2), r2(col1))
2579
2611
  */
2580
2612
  rollup?: RollupProperty | null;
2613
+ /**
2614
+ * ClickHouse: UUID 'xxx' clause after table name
2615
+ */
2616
+ uuid?: string | null;
2617
+ };
2618
+
2619
+ /**
2620
+ * Snowflake CREATE TASK statement
2621
+ */
2622
+ declare type CreateTask = {
2623
+ or_replace: boolean;
2624
+ if_not_exists: boolean;
2625
+ /**
2626
+ * Task name (possibly qualified: db.schema.task)
2627
+ */
2628
+ name: string;
2629
+ /**
2630
+ * Raw text of properties between name and AS (WAREHOUSE, SCHEDULE, etc.)
2631
+ */
2632
+ properties: string;
2633
+ /**
2634
+ * The SQL statement body after AS
2635
+ */
2636
+ body: Expression;
2581
2637
  };
2582
2638
 
2583
2639
  /**
@@ -2596,6 +2652,10 @@ declare type CreateTrigger = {
2596
2652
  when_paren?: boolean;
2597
2653
  body: TriggerBody;
2598
2654
  or_replace: boolean;
2655
+ /**
2656
+ * TSQL: CREATE OR ALTER
2657
+ */
2658
+ or_alter?: boolean;
2599
2659
  constraint: boolean;
2600
2660
  deferrable: boolean | null;
2601
2661
  initially_deferred: boolean | null;
@@ -2619,6 +2679,10 @@ declare type CreateView = {
2619
2679
  columns: Array<ViewColumn>;
2620
2680
  query: Expression;
2621
2681
  or_replace: boolean;
2682
+ /**
2683
+ * TSQL: CREATE OR ALTER
2684
+ */
2685
+ or_alter?: boolean;
2622
2686
  if_not_exists: boolean;
2623
2687
  materialized: boolean;
2624
2688
  temporary: boolean;
@@ -3271,6 +3335,10 @@ export default _default;
3271
3335
  */
3272
3336
  declare type DefaultColumnConstraint = {
3273
3337
  this: Expression;
3338
+ /**
3339
+ * TSQL: DEFAULT value FOR column (table-level default constraint)
3340
+ */
3341
+ for_column?: Identifier | null;
3274
3342
  };
3275
3343
 
3276
3344
  /**
@@ -3741,6 +3809,14 @@ declare type DropTable = {
3741
3809
  * ClickHouse: SYNC modifier
3742
3810
  */
3743
3811
  sync: boolean;
3812
+ /**
3813
+ * Snowflake: DROP ICEBERG TABLE
3814
+ */
3815
+ iceberg: boolean;
3816
+ /**
3817
+ * RESTRICT modifier (opposite of CASCADE)
3818
+ */
3819
+ restrict: boolean;
3744
3820
  };
3745
3821
 
3746
3822
  /**
@@ -3994,6 +4070,10 @@ declare type ExecuteParameter = {
3994
4070
  * Whether this is a positional parameter (no = sign)
3995
4071
  */
3996
4072
  positional?: boolean;
4073
+ /**
4074
+ * TSQL OUTPUT modifier on parameter
4075
+ */
4076
+ output?: boolean;
3997
4077
  };
3998
4078
 
3999
4079
  /**
@@ -4009,6 +4089,10 @@ declare type ExecuteStatement = {
4009
4089
  * Named parameters: @param=value pairs
4010
4090
  */
4011
4091
  parameters: Array<ExecuteParameter>;
4092
+ /**
4093
+ * Trailing clause text (e.g. WITH RESULT SETS ((...)))
4094
+ */
4095
+ suffix?: string | null;
4012
4096
  };
4013
4097
 
4014
4098
  /**
@@ -4918,6 +5002,8 @@ declare type Expression = {
4918
5002
  "drop_procedure": DropProcedure;
4919
5003
  } | {
4920
5004
  "create_sequence": CreateSequence;
5005
+ } | {
5006
+ "create_synonym": CreateSynonym;
4921
5007
  } | {
4922
5008
  "drop_sequence": DropSequence;
4923
5009
  } | {
@@ -4940,6 +5026,8 @@ declare type Expression = {
4940
5026
  "kill": Kill;
4941
5027
  } | {
4942
5028
  "execute": ExecuteStatement;
5029
+ } | {
5030
+ "create_task": CreateTask;
4943
5031
  } | {
4944
5032
  "raw": Raw;
4945
5033
  } | {
@@ -6824,6 +6912,10 @@ declare type GrantPrincipal = {
6824
6912
  * Whether prefixed with GROUP keyword (Redshift)
6825
6913
  */
6826
6914
  is_group: boolean;
6915
+ /**
6916
+ * Whether prefixed with SHARE keyword (Snowflake)
6917
+ */
6918
+ is_share: boolean;
6827
6919
  };
6828
6920
 
6829
6921
  /**
@@ -12709,6 +12801,10 @@ declare type TableRef = {
12709
12801
  * Column aliases for table alias: AS t(c1, c2)
12710
12802
  */
12711
12803
  column_aliases: Array<Identifier>;
12804
+ /**
12805
+ * Leading comments that appeared before this table reference in a FROM clause
12806
+ */
12807
+ leading_comments?: Array<string>;
12712
12808
  /**
12713
12809
  * Trailing comments that appeared after this table reference
12714
12810
  */
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polyglot-sql/sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "SQL dialect translator powered by WebAssembly",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",