@sqlanvil/core 1.10.0 → 1.12.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/configs.proto CHANGED
@@ -106,7 +106,9 @@ message Environment {
106
106
 
107
107
  // A named connection: the warehouse (read/write target) or a read-only source.
108
108
  message ConnectionConfig {
109
- // Optional. One of "bigquery", "postgres", "supabase".
109
+ // Optional. One of "bigquery", "postgres", "supabase", "mysql".
110
+ // ("mysql" is supported by `sqlanvil introspect` for schema scaffolding; a runtime
111
+ // cross-warehouse MySQL *source* bridge is not yet implemented — see issue #35.)
110
112
  string platform = 1;
111
113
  // Optional. BigQuery source default project.
112
114
  string project = 2;
@@ -708,6 +710,55 @@ message ActionConfig {
708
710
  ExportOptions export = 10;
709
711
  }
710
712
 
713
+ // The user-facing `import: {}` block on a `type: "import"` action.
714
+ message ImportOptions {
715
+ // Source file/glob/URI to read: gs:// | s3:// | local:// | relative/absolute path.
716
+ // Used verbatim (unlike export, where the filename is derived) — point it at the exact
717
+ // file or glob (e.g. gs://bucket/orders/*.parquet).
718
+ string location = 1;
719
+ // "parquet" | "csv" | "json" (json = JSONL).
720
+ string format = 2;
721
+ // Replace the destination table (drop + create). Defaults to true. When false, rows are
722
+ // appended (INSERT … SELECT) into an existing table.
723
+ bool overwrite = 3;
724
+ // Format-specific passthrough options (reserved for future reader options).
725
+ map<string, string> options = 4;
726
+ }
727
+
728
+ // Configuration for a `type: "import"` action: loads a Parquet/CSV/JSON file into a table in
729
+ // the warehouse (the inverse of `type: "export"`). The resulting table is ref()-able.
730
+ message ImportConfig {
731
+ // The name of the import (the destination table name).
732
+ string name = 1;
733
+
734
+ // The dataset (schema) used to qualify the import's target name.
735
+ string dataset = 2;
736
+
737
+ // The Google Cloud project (database) of the import.
738
+ string project = 3;
739
+
740
+ // Targets of actions that this action is dependent on.
741
+ repeated Target dependency_targets = 4;
742
+
743
+ // Path to the source .sqlx file the action is defined in (generated).
744
+ string filename = 5;
745
+
746
+ // A list of user-defined tags with which the action should be labeled.
747
+ repeated string tags = 6;
748
+
749
+ // If set to true, this action will not be executed.
750
+ bool disabled = 7;
751
+
752
+ // Description of the import.
753
+ string description = 8;
754
+
755
+ // If true, this action only depends on data from explicitly-declared dependencies.
756
+ bool hermetic = 9;
757
+
758
+ // The import source + format options (the `import: {}` block).
759
+ ImportOptions import = 10;
760
+ }
761
+
711
762
  message DeclarationConfig {
712
763
  // The name of the declaration.
713
764
  string name = 1;
@@ -833,6 +884,7 @@ message ActionConfig {
833
884
  ForeignWrapperConfig foreign_wrapper = 11;
834
885
  VectorIndexConfig vector_index = 12;
835
886
  ExportConfig export = 13;
887
+ ImportConfig import = 14;
836
888
  }
837
889
 
838
890
  message RlsPolicyConfig {
@@ -1046,6 +1098,37 @@ message MysqlOptions {
1046
1098
  bool unique = 3;
1047
1099
  }
1048
1100
  repeated Index indexes = 4;
1101
+
1102
+ // Native MySQL/MariaDB partitioning. NB: MySQL requires every column used in the
1103
+ // partitioning expression to be part of every UNIQUE/PRIMARY key — so a partitioned
1104
+ // incremental table's `uniqueKey` must include the partition column(s).
1105
+ message Partition {
1106
+ enum Kind {
1107
+ RANGE = 0;
1108
+ LIST = 1;
1109
+ HASH = 2;
1110
+ KEY = 3;
1111
+ }
1112
+ Kind kind = 1;
1113
+
1114
+ // The expression/columns inside `PARTITION BY <kind> (...)`, emitted verbatim.
1115
+ // For RANGE/LIST: a column or expression (e.g. "id", "YEAR(created_at)").
1116
+ // For HASH/KEY: a column list. (RANGE COLUMNS / LIST COLUMNS not modeled in v1.)
1117
+ string expression = 2;
1118
+
1119
+ // RANGE/LIST child partitions. `values` is the raw clause body after the name,
1120
+ // e.g. "VALUES LESS THAN (2024)" (range, use MAXVALUE for a catch-all) or
1121
+ // "VALUES IN ('us', 'ca')" (list).
1122
+ message Bound {
1123
+ string name = 1;
1124
+ string values = 2;
1125
+ }
1126
+ repeated Bound partitions = 3;
1127
+
1128
+ // HASH/KEY partition count, emitted as `PARTITIONS <n>`. Ignored for RANGE/LIST.
1129
+ uint32 count = 4;
1130
+ }
1131
+ Partition partition = 5;
1049
1132
  }
1050
1133
 
1051
1134
  // SupabaseOptions — Supabase-specific platform features layered on top of
package/core.proto CHANGED
@@ -287,6 +287,28 @@ message Export {
287
287
  string jit_code = 15;
288
288
  }
289
289
 
290
+ // A compiled file import: loads the file at `location` into the table at `target`. The inverse
291
+ // of Export — a producer whose target is ref()-able by downstream actions.
292
+ message Import {
293
+ Target target = 1;
294
+ Target canonical_target = 2;
295
+ repeated Target dependency_targets = 3;
296
+ ActionHermeticity hermeticity = 4;
297
+ bool disabled = 5;
298
+ repeated string tags = 6;
299
+ ActionDescriptor action_descriptor = 7;
300
+ // Source file/glob/URI to read (used verbatim).
301
+ string location = 8;
302
+ // "parquet" | "csv" | "json".
303
+ string format = 9;
304
+ // Replace (drop + create) vs append (INSERT … SELECT). Defaults true.
305
+ bool overwrite = 10;
306
+ map<string, string> options = 11;
307
+ // Source .sqlx file path (generated).
308
+ string file_name = 12;
309
+ string jit_code = 13;
310
+ }
311
+
290
312
  message Assertion {
291
313
  Target target = 8;
292
314
  Target canonical_target = 13;
@@ -456,6 +478,7 @@ message CompiledGraph {
456
478
  repeated Notebook notebooks = 12;
457
479
  repeated DataPreparation data_preparations = 13;
458
480
  repeated Export exports = 14;
481
+ repeated Import imports = 16;
459
482
 
460
483
  GraphErrors graph_errors = 7;
461
484
 
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "version": "1.10.0",
37
+ "version": "1.12.0",
38
38
  "name": "@sqlanvil/core",
39
39
  "description": "sqlanvil core API.",
40
40
  "main": "bundle.js"