@sqlanvil/core 1.14.0 → 1.16.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/bundle.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as $protobuf from 'protobufjs';
2
+ import Long from 'long';
2
3
 
3
4
  declare function compile(code: string, path: string): string;
4
5
 
@@ -360,6 +361,9 @@ namespace sqlanvil {
360
361
 
361
362
  /** ConnectionConfig defaultSchema */
362
363
  defaultSchema?: (string|null);
364
+
365
+ /** ConnectionConfig mode */
366
+ mode?: (string|null);
363
367
  }
364
368
 
365
369
  /** Represents a ConnectionConfig. */
@@ -398,6 +402,9 @@ namespace sqlanvil {
398
402
  /** ConnectionConfig defaultSchema. */
399
403
  public defaultSchema: string;
400
404
 
405
+ /** ConnectionConfig mode. */
406
+ public mode: string;
407
+
401
408
  /**
402
409
  * Creates a new ConnectionConfig instance using the specified properties.
403
410
  * @param [properties] Properties to set
@@ -8474,6 +8481,187 @@ namespace sqlanvil {
8474
8481
  public static getTypeUrl(typeUrlPrefix?: string): string;
8475
8482
  }
8476
8483
 
8484
+ /** Properties of an Extract. */
8485
+ interface IExtract {
8486
+
8487
+ /** Extract target */
8488
+ target?: (sqlanvil.ITarget|null);
8489
+
8490
+ /** Extract canonicalTarget */
8491
+ canonicalTarget?: (sqlanvil.ITarget|null);
8492
+
8493
+ /** Extract dependencyTargets */
8494
+ dependencyTargets?: (sqlanvil.ITarget[]|null);
8495
+
8496
+ /** Extract hermeticity */
8497
+ hermeticity?: (sqlanvil.ActionHermeticity|null);
8498
+
8499
+ /** Extract disabled */
8500
+ disabled?: (boolean|null);
8501
+
8502
+ /** Extract tags */
8503
+ tags?: (string[]|null);
8504
+
8505
+ /** Extract actionDescriptor */
8506
+ actionDescriptor?: (sqlanvil.IActionDescriptor|null);
8507
+
8508
+ /** Extract connectionName */
8509
+ connectionName?: (string|null);
8510
+
8511
+ /** Extract platform */
8512
+ platform?: (string|null);
8513
+
8514
+ /** Extract project */
8515
+ project?: (string|null);
8516
+
8517
+ /** Extract dataset */
8518
+ dataset?: (string|null);
8519
+
8520
+ /** Extract sourceName */
8521
+ sourceName?: (string|null);
8522
+
8523
+ /** Extract billingProject */
8524
+ billingProject?: (string|null);
8525
+
8526
+ /** Extract columnTypes */
8527
+ columnTypes?: ({ [k: string]: string }|null);
8528
+
8529
+ /** Extract fileName */
8530
+ fileName?: (string|null);
8531
+ }
8532
+
8533
+ /** Represents an Extract. */
8534
+ class Extract implements IExtract {
8535
+
8536
+ /**
8537
+ * Constructs a new Extract.
8538
+ * @param [properties] Properties to set
8539
+ */
8540
+ constructor(properties?: sqlanvil.IExtract);
8541
+
8542
+ /** Extract target. */
8543
+ public target?: (sqlanvil.ITarget|null);
8544
+
8545
+ /** Extract canonicalTarget. */
8546
+ public canonicalTarget?: (sqlanvil.ITarget|null);
8547
+
8548
+ /** Extract dependencyTargets. */
8549
+ public dependencyTargets: sqlanvil.ITarget[];
8550
+
8551
+ /** Extract hermeticity. */
8552
+ public hermeticity: sqlanvil.ActionHermeticity;
8553
+
8554
+ /** Extract disabled. */
8555
+ public disabled: boolean;
8556
+
8557
+ /** Extract tags. */
8558
+ public tags: string[];
8559
+
8560
+ /** Extract actionDescriptor. */
8561
+ public actionDescriptor?: (sqlanvil.IActionDescriptor|null);
8562
+
8563
+ /** Extract connectionName. */
8564
+ public connectionName: string;
8565
+
8566
+ /** Extract platform. */
8567
+ public platform: string;
8568
+
8569
+ /** Extract project. */
8570
+ public project: string;
8571
+
8572
+ /** Extract dataset. */
8573
+ public dataset: string;
8574
+
8575
+ /** Extract sourceName. */
8576
+ public sourceName: string;
8577
+
8578
+ /** Extract billingProject. */
8579
+ public billingProject: string;
8580
+
8581
+ /** Extract columnTypes. */
8582
+ public columnTypes: { [k: string]: string };
8583
+
8584
+ /** Extract fileName. */
8585
+ public fileName: string;
8586
+
8587
+ /**
8588
+ * Creates a new Extract instance using the specified properties.
8589
+ * @param [properties] Properties to set
8590
+ * @returns Extract instance
8591
+ */
8592
+ public static create(properties?: sqlanvil.IExtract): sqlanvil.Extract;
8593
+
8594
+ /**
8595
+ * Encodes the specified Extract message. Does not implicitly {@link sqlanvil.Extract.verify|verify} messages.
8596
+ * @param message Extract message or plain object to encode
8597
+ * @param [writer] Writer to encode to
8598
+ * @returns Writer
8599
+ */
8600
+ public static encode(message: sqlanvil.IExtract, writer?: $protobuf.Writer): $protobuf.Writer;
8601
+
8602
+ /**
8603
+ * Encodes the specified Extract message, length delimited. Does not implicitly {@link sqlanvil.Extract.verify|verify} messages.
8604
+ * @param message Extract message or plain object to encode
8605
+ * @param [writer] Writer to encode to
8606
+ * @returns Writer
8607
+ */
8608
+ public static encodeDelimited(message: sqlanvil.IExtract, writer?: $protobuf.Writer): $protobuf.Writer;
8609
+
8610
+ /**
8611
+ * Decodes an Extract message from the specified reader or buffer.
8612
+ * @param reader Reader or buffer to decode from
8613
+ * @param [length] Message length if known beforehand
8614
+ * @returns Extract
8615
+ * @throws {Error} If the payload is not a reader or valid buffer
8616
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
8617
+ */
8618
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): sqlanvil.Extract;
8619
+
8620
+ /**
8621
+ * Decodes an Extract message from the specified reader or buffer, length delimited.
8622
+ * @param reader Reader or buffer to decode from
8623
+ * @returns Extract
8624
+ * @throws {Error} If the payload is not a reader or valid buffer
8625
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
8626
+ */
8627
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): sqlanvil.Extract;
8628
+
8629
+ /**
8630
+ * Verifies an Extract message.
8631
+ * @param message Plain object to verify
8632
+ * @returns `null` if valid, otherwise the reason why it is not
8633
+ */
8634
+ public static verify(message: { [k: string]: any }): (string|null);
8635
+
8636
+ /**
8637
+ * Creates an Extract message from a plain object. Also converts values to their respective internal types.
8638
+ * @param object Plain object
8639
+ * @returns Extract
8640
+ */
8641
+ public static fromObject(object: { [k: string]: any }): sqlanvil.Extract;
8642
+
8643
+ /**
8644
+ * Creates a plain object from an Extract message. Also converts values to other types if specified.
8645
+ * @param message Extract
8646
+ * @param [options] Conversion options
8647
+ * @returns Plain object
8648
+ */
8649
+ public static toObject(message: sqlanvil.Extract, options?: $protobuf.IConversionOptions): { [k: string]: any };
8650
+
8651
+ /**
8652
+ * Converts this Extract to JSON.
8653
+ * @returns JSON object
8654
+ */
8655
+ public toJSON(): { [k: string]: any };
8656
+
8657
+ /**
8658
+ * Gets the default type url for Extract
8659
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
8660
+ * @returns The default type url
8661
+ */
8662
+ public static getTypeUrl(typeUrlPrefix?: string): string;
8663
+ }
8664
+
8477
8665
  /** Properties of an Assertion. */
8478
8666
  interface IAssertion {
8479
8667
 
@@ -9875,6 +10063,9 @@ namespace sqlanvil {
9875
10063
  /** CompiledGraph imports */
9876
10064
  imports?: (sqlanvil.IImport[]|null);
9877
10065
 
10066
+ /** CompiledGraph extracts */
10067
+ extracts?: (sqlanvil.IExtract[]|null);
10068
+
9878
10069
  /** CompiledGraph graphErrors */
9879
10070
  graphErrors?: (sqlanvil.IGraphErrors|null);
9880
10071
 
@@ -9927,6 +10118,9 @@ namespace sqlanvil {
9927
10118
  /** CompiledGraph imports. */
9928
10119
  public imports: sqlanvil.IImport[];
9929
10120
 
10121
+ /** CompiledGraph extracts. */
10122
+ public extracts: sqlanvil.IExtract[];
10123
+
9930
10124
  /** CompiledGraph graphErrors. */
9931
10125
  public graphErrors?: (sqlanvil.IGraphErrors|null);
9932
10126
 
@@ -11934,6 +12128,139 @@ namespace sqlanvil {
11934
12128
  public static getTypeUrl(typeUrlPrefix?: string): string;
11935
12129
  }
11936
12130
 
12131
+ /** Properties of an ExtractSpec. */
12132
+ interface IExtractSpec {
12133
+
12134
+ /** ExtractSpec connectionName */
12135
+ connectionName?: (string|null);
12136
+
12137
+ /** ExtractSpec platform */
12138
+ platform?: (string|null);
12139
+
12140
+ /** ExtractSpec project */
12141
+ project?: (string|null);
12142
+
12143
+ /** ExtractSpec dataset */
12144
+ dataset?: (string|null);
12145
+
12146
+ /** ExtractSpec sourceName */
12147
+ sourceName?: (string|null);
12148
+
12149
+ /** ExtractSpec billingProject */
12150
+ billingProject?: (string|null);
12151
+
12152
+ /** ExtractSpec columnTypes */
12153
+ columnTypes?: ({ [k: string]: string }|null);
12154
+ }
12155
+
12156
+ /** Represents an ExtractSpec. */
12157
+ class ExtractSpec implements IExtractSpec {
12158
+
12159
+ /**
12160
+ * Constructs a new ExtractSpec.
12161
+ * @param [properties] Properties to set
12162
+ */
12163
+ constructor(properties?: sqlanvil.IExtractSpec);
12164
+
12165
+ /** ExtractSpec connectionName. */
12166
+ public connectionName: string;
12167
+
12168
+ /** ExtractSpec platform. */
12169
+ public platform: string;
12170
+
12171
+ /** ExtractSpec project. */
12172
+ public project: string;
12173
+
12174
+ /** ExtractSpec dataset. */
12175
+ public dataset: string;
12176
+
12177
+ /** ExtractSpec sourceName. */
12178
+ public sourceName: string;
12179
+
12180
+ /** ExtractSpec billingProject. */
12181
+ public billingProject: string;
12182
+
12183
+ /** ExtractSpec columnTypes. */
12184
+ public columnTypes: { [k: string]: string };
12185
+
12186
+ /**
12187
+ * Creates a new ExtractSpec instance using the specified properties.
12188
+ * @param [properties] Properties to set
12189
+ * @returns ExtractSpec instance
12190
+ */
12191
+ public static create(properties?: sqlanvil.IExtractSpec): sqlanvil.ExtractSpec;
12192
+
12193
+ /**
12194
+ * Encodes the specified ExtractSpec message. Does not implicitly {@link sqlanvil.ExtractSpec.verify|verify} messages.
12195
+ * @param message ExtractSpec message or plain object to encode
12196
+ * @param [writer] Writer to encode to
12197
+ * @returns Writer
12198
+ */
12199
+ public static encode(message: sqlanvil.IExtractSpec, writer?: $protobuf.Writer): $protobuf.Writer;
12200
+
12201
+ /**
12202
+ * Encodes the specified ExtractSpec message, length delimited. Does not implicitly {@link sqlanvil.ExtractSpec.verify|verify} messages.
12203
+ * @param message ExtractSpec message or plain object to encode
12204
+ * @param [writer] Writer to encode to
12205
+ * @returns Writer
12206
+ */
12207
+ public static encodeDelimited(message: sqlanvil.IExtractSpec, writer?: $protobuf.Writer): $protobuf.Writer;
12208
+
12209
+ /**
12210
+ * Decodes an ExtractSpec message from the specified reader or buffer.
12211
+ * @param reader Reader or buffer to decode from
12212
+ * @param [length] Message length if known beforehand
12213
+ * @returns ExtractSpec
12214
+ * @throws {Error} If the payload is not a reader or valid buffer
12215
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
12216
+ */
12217
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): sqlanvil.ExtractSpec;
12218
+
12219
+ /**
12220
+ * Decodes an ExtractSpec message from the specified reader or buffer, length delimited.
12221
+ * @param reader Reader or buffer to decode from
12222
+ * @returns ExtractSpec
12223
+ * @throws {Error} If the payload is not a reader or valid buffer
12224
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
12225
+ */
12226
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): sqlanvil.ExtractSpec;
12227
+
12228
+ /**
12229
+ * Verifies an ExtractSpec message.
12230
+ * @param message Plain object to verify
12231
+ * @returns `null` if valid, otherwise the reason why it is not
12232
+ */
12233
+ public static verify(message: { [k: string]: any }): (string|null);
12234
+
12235
+ /**
12236
+ * Creates an ExtractSpec message from a plain object. Also converts values to their respective internal types.
12237
+ * @param object Plain object
12238
+ * @returns ExtractSpec
12239
+ */
12240
+ public static fromObject(object: { [k: string]: any }): sqlanvil.ExtractSpec;
12241
+
12242
+ /**
12243
+ * Creates a plain object from an ExtractSpec message. Also converts values to other types if specified.
12244
+ * @param message ExtractSpec
12245
+ * @param [options] Conversion options
12246
+ * @returns Plain object
12247
+ */
12248
+ public static toObject(message: sqlanvil.ExtractSpec, options?: $protobuf.IConversionOptions): { [k: string]: any };
12249
+
12250
+ /**
12251
+ * Converts this ExtractSpec to JSON.
12252
+ * @returns JSON object
12253
+ */
12254
+ public toJSON(): { [k: string]: any };
12255
+
12256
+ /**
12257
+ * Gets the default type url for ExtractSpec
12258
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
12259
+ * @returns The default type url
12260
+ */
12261
+ public static getTypeUrl(typeUrlPrefix?: string): string;
12262
+ }
12263
+
11937
12264
  /** Properties of an ExecutionAction. */
11938
12265
  interface IExecutionAction {
11939
12266
 
@@ -11969,6 +12296,9 @@ namespace sqlanvil {
11969
12296
 
11970
12297
  /** ExecutionAction import */
11971
12298
  "import"?: (sqlanvil.IImportSpec|null);
12299
+
12300
+ /** ExecutionAction extract */
12301
+ extract?: (sqlanvil.IExtractSpec|null);
11972
12302
  }
11973
12303
 
11974
12304
  /** Represents an ExecutionAction. */
@@ -12013,6 +12343,9 @@ namespace sqlanvil {
12013
12343
  /** ExecutionAction import. */
12014
12344
  public import?: (sqlanvil.IImportSpec|null);
12015
12345
 
12346
+ /** ExecutionAction extract. */
12347
+ public extract?: (sqlanvil.IExtractSpec|null);
12348
+
12016
12349
  /**
12017
12350
  * Creates a new ExecutionAction instance using the specified properties.
12018
12351
  * @param [properties] Properties to set
@@ -15343,6 +15676,49 @@ declare class Export extends ActionBuilder<sqlanvil.Export> {
15343
15676
  private verifyConfig;
15344
15677
  }
15345
15678
 
15679
+ declare abstract class ActionBuilder<T> {
15680
+ session: Session;
15681
+ includeAssertionsForDependency: Map<string, boolean>;
15682
+ constructor(session?: Session);
15683
+ applySessionToTarget(targetFromConfig: sqlanvil.Target, projectConfig: sqlanvil.ProjectConfig, fileName?: string, options?: {
15684
+ validateTarget?: boolean;
15685
+ useDefaultAssertionDataset?: boolean;
15686
+ }): sqlanvil.Target;
15687
+ finalizeTarget(targetFromConfig: sqlanvil.Target): sqlanvil.Target;
15688
+ abstract getFileName(): string;
15689
+ abstract getTarget(): sqlanvil.Target;
15690
+ abstract compile(): T;
15691
+ protected generateInlineAssertions(tableAssertionsConfig: sqlanvil.ActionConfig.TableAssertionsConfig, proto: sqlanvil.Table): {
15692
+ uniqueKeyAssertions: any[];
15693
+ rowConditionsAssertion?: any;
15694
+ };
15695
+ private validateTarget;
15696
+ }
15697
+
15698
+ interface IExtractConfig {
15699
+ name: string;
15700
+ schema?: string;
15701
+ connectionName: string;
15702
+ platform: string;
15703
+ project?: string;
15704
+ dataset?: string;
15705
+ sourceName?: string;
15706
+ billingProject?: string;
15707
+ columnTypes?: {
15708
+ [key: string]: string;
15709
+ };
15710
+ filename?: string;
15711
+ }
15712
+ declare class Extract extends ActionBuilder<sqlanvil.Extract> {
15713
+ session: Session;
15714
+ private proto;
15715
+ private config;
15716
+ constructor(session: Session, config: IExtractConfig);
15717
+ getFileName(): string;
15718
+ getTarget(): sqlanvil.Target;
15719
+ compile(): sqlanvil.Extract;
15720
+ }
15721
+
15346
15722
  declare class Import extends ActionBuilder<sqlanvil.Import> {
15347
15723
  session: Session;
15348
15724
  dependOnDependencyAssertions: boolean;
@@ -15597,25 +15973,6 @@ declare class View extends ActionBuilder<sqlanvil.Table> {
15597
15973
  private verifyConfig;
15598
15974
  }
15599
15975
 
15600
- declare abstract class ActionBuilder<T> {
15601
- session: Session;
15602
- includeAssertionsForDependency: Map<string, boolean>;
15603
- constructor(session?: Session);
15604
- applySessionToTarget(targetFromConfig: sqlanvil.Target, projectConfig: sqlanvil.ProjectConfig, fileName?: string, options?: {
15605
- validateTarget?: boolean;
15606
- useDefaultAssertionDataset?: boolean;
15607
- }): sqlanvil.Target;
15608
- finalizeTarget(targetFromConfig: sqlanvil.Target): sqlanvil.Target;
15609
- abstract getFileName(): string;
15610
- abstract getTarget(): sqlanvil.Target;
15611
- abstract compile(): T;
15612
- protected generateInlineAssertions(tableAssertionsConfig: sqlanvil.ActionConfig.TableAssertionsConfig, proto: sqlanvil.Table): {
15613
- uniqueKeyAssertions: any[];
15614
- rowConditionsAssertion?: any;
15615
- };
15616
- private validateTarget;
15617
- }
15618
-
15619
15976
  interface IRlsPolicyConfig {
15620
15977
  table: string;
15621
15978
  name: string;
@@ -15744,7 +16101,7 @@ interface IRecordDescriptor {
15744
16101
  bigqueryPolicyTags?: string | string[];
15745
16102
  }
15746
16103
 
15747
- declare type Action = Table | View | IncrementalTable | Operation | Assertion | Declaration | Notebook | DataPreparation | Export | Import | Test | RlsPolicy | RealtimePublication | Wrapper | ForeignTable | VectorIndex;
16104
+ declare type Action = Table | View | IncrementalTable | Operation | Assertion | Declaration | Notebook | DataPreparation | Export | Extract | Import | Test | RlsPolicy | RealtimePublication | Wrapper | ForeignTable | VectorIndex;
15748
16105
  interface INamedConfig {
15749
16106
  type?: string;
15750
16107
  name?: string;
@@ -15845,6 +16202,7 @@ declare class Session {
15845
16202
  constructor(rootDir?: string, projectConfig?: sqlanvil.ProjectConfig, originalProjectConfig?: sqlanvil.ProjectConfig);
15846
16203
  init(rootDir: string, projectConfig?: sqlanvil.ProjectConfig, originalProjectConfig?: sqlanvil.ProjectConfig): void;
15847
16204
  compilationSql(): CompilationSql;
16205
+ getContents(filePath: string): string;
15848
16206
  sqlxAction(actionOptions: {
15849
16207
  sqlxConfig: any;
15850
16208
  sqlStatementCount: number;
@@ -15900,7 +16258,7 @@ declare function jitCompiler(rpcCallback: RpcCallback): IJitCompiler;
15900
16258
 
15901
16259
  declare function main(coreExecutionRequest: Uint8Array | string): Uint8Array | string;
15902
16260
 
15903
- declare const version = "1.14.0";
16261
+ declare const version = "1.16.0";
15904
16262
 
15905
16263
  declare const session: Session;
15906
16264
  declare const supportedFeatures: sqlanvil.SupportedFeatures[];