@sqlanvil/core 1.18.0 → 1.20.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
@@ -451,6 +451,11 @@ message ActionConfig {
451
451
  // ("on_dependency_change" → in-place REFRESH instead of drop+recreate)
452
452
  // apply; indexes also apply to materialized views.
453
453
  PostgresOptions postgres = 22;
454
+
455
+ // MySQL/MariaDB-native options. Only meaningful for a materialized view
456
+ // (materialized: true), which MySQL emulates as a refreshed table snapshot —
457
+ // engine/charset/collation/row_format and indexes apply to that table.
458
+ MysqlOptions mysql = 23;
454
459
  }
455
460
 
456
461
  enum OnSchemaChange {
@@ -883,6 +888,57 @@ message ActionConfig {
883
888
  }
884
889
  }
885
890
 
891
+ // Configuration for a script action: an execution-time user script (Python in v1) that stages
892
+ // files / runs glue steps as a first-class DAG node. Language-neutral by design — `language`
893
+ // selects the per-language resolver in the CLI; the friendly `python:` actions.yaml key is
894
+ // sugar that normalizes to `script: { language: "python", ... }`. Scripts never receive
895
+ // warehouse credentials; they produce files, and `type: "import"` is the loading boundary.
896
+ message ScriptConfig {
897
+ // The name of the script action (how downstream actions depend on it).
898
+ string name = 1;
899
+
900
+ // The dataset (schema) used to qualify the script's target name.
901
+ string dataset = 2;
902
+
903
+ // The project (database) used to qualify the script's target name.
904
+ string project = 3;
905
+
906
+ // Targets of actions that this action is dependent on.
907
+ repeated Target dependency_targets = 4;
908
+
909
+ // Path to the script file to execute, relative to the project root.
910
+ string filename = 5;
911
+
912
+ // A list of user-defined tags with which the action should be labeled.
913
+ repeated string tags = 6;
914
+
915
+ // If set to true, this action will not be executed.
916
+ bool disabled = 7;
917
+
918
+ // Description of the script action.
919
+ string description = 8;
920
+
921
+ // Script language ("python" in v1). Set automatically by the `python:` sugar.
922
+ string language = 9;
923
+
924
+ // Arguments passed verbatim to the script.
925
+ repeated string args = 10;
926
+
927
+ // Declared dependency manifest, relative to the project root (requirements.txt for
928
+ // python). sqlanvil validates the environment against it but never installs anything.
929
+ string deps_file = 11;
930
+
931
+ // Runtime version specifier (a PEP 440 specifier for python, e.g. ">=3.11").
932
+ string runtime_version = 12;
933
+
934
+ // Environment root directory, relative to the project root (a venv for python) — its
935
+ // interpreter runs the script. When unset, the interpreter is resolved from PATH.
936
+ string env_root = 13;
937
+
938
+ // Per-action timeout in milliseconds. 0 means the default (30 minutes).
939
+ int32 timeout_millis = 14;
940
+ }
941
+
886
942
  oneof action {
887
943
  TableConfig table = 1;
888
944
  ViewConfig view = 2;
@@ -898,6 +954,7 @@ message ActionConfig {
898
954
  VectorIndexConfig vector_index = 12;
899
955
  ExportConfig export = 13;
900
956
  ImportConfig import = 14;
957
+ ScriptConfig script = 15;
901
958
  }
902
959
 
903
960
  message RlsPolicyConfig {
@@ -1091,9 +1148,8 @@ message PostgresOptions {
1091
1148
  string refresh_policy = 7;
1092
1149
  }
1093
1150
 
1094
- // MySQL/MariaDB table options + secondary indexes. First cut: engine/charset/
1095
- // collation and plain/unique secondary indexes. (No partitioning, FULLTEXT/
1096
- // SPATIAL/prefix indexes, or row_format yet — those are later follow-ups.)
1151
+ // MySQL/MariaDB table options, secondary indexes (plain/unique/fulltext/spatial,
1152
+ // with optional per-column prefix lengths), row_format, and native partitioning.
1097
1153
  message MysqlOptions {
1098
1154
  // Storage engine, emitted as ENGINE=<engine> (e.g. "InnoDB", "MyISAM").
1099
1155
  // Omit to use the server default.
@@ -1102,13 +1158,24 @@ message MysqlOptions {
1102
1158
  string charset = 2;
1103
1159
  // Default collation, emitted as COLLATE=<collation> (e.g. "utf8mb4_unicode_ci").
1104
1160
  string collation = 3;
1161
+ // Row format, emitted as ROW_FORMAT=<row_format> (e.g. "DYNAMIC", "COMPRESSED",
1162
+ // "COMPACT", "REDUNDANT"). Omit to use the engine default.
1163
+ string row_format = 6;
1105
1164
 
1106
1165
  message Index {
1107
1166
  // Optional; when omitted, derived as <table>_<cols>_idx (or _key if unique),
1108
1167
  // capped at 63 chars.
1109
1168
  string name = 1;
1169
+ // Column names. A column may carry a prefix length in MySQL's own syntax —
1170
+ // "description(50)" — emitted as `description`(50) (required to index BLOB/TEXT,
1171
+ // optional elsewhere).
1110
1172
  repeated string columns = 2;
1111
1173
  bool unique = 3;
1174
+ // Index type: "" (default B-tree/engine default), "fulltext", or "spatial".
1175
+ // Mutually exclusive with `unique`. NB a SPATIAL index requires a NOT NULL
1176
+ // SRID-attributed geometry column — CTAS-created columns are nullable, so
1177
+ // spatial usually needs an `ALTER TABLE ... MODIFY` pre-step in post_operations.
1178
+ string type = 4;
1112
1179
  }
1113
1180
  repeated Index indexes = 4;
1114
1181
 
package/core.proto CHANGED
@@ -341,6 +341,40 @@ message Extract {
341
341
  string database = 16;
342
342
  }
343
343
 
344
+ // An execution-time script action (user code — Python in v1): file-staging and glue steps as
345
+ // first-class DAG nodes, ordered by dependencies and covered by run history. The script runs
346
+ // runner-side (a spawned interpreter with cwd = project dir), never on the warehouse, and no
347
+ // warehouse credentials are ever injected — scripts produce files; `type: "import"` loads them.
348
+ // Language-neutral by design: `language` selects the per-language resolver in the CLI, so a new
349
+ // language is a resolver + config sugar, not a proto migration.
350
+ message Script {
351
+ Target target = 1;
352
+ Target canonical_target = 2;
353
+ repeated Target dependency_targets = 3;
354
+ ActionHermeticity hermeticity = 4;
355
+ bool disabled = 5;
356
+ repeated string tags = 6;
357
+ ActionDescriptor action_descriptor = 7;
358
+ // Script language ("python" in v1).
359
+ string language = 8;
360
+ // Script path relative to the project root.
361
+ string script_filename = 9;
362
+ // Arguments passed verbatim to the script.
363
+ repeated string args = 10;
364
+ // Declared dependency manifest relative to the project root (requirements.txt for python).
365
+ // Validated by `sqlanvil validate`, never installed.
366
+ string deps_file = 11;
367
+ // Runtime version specifier (PEP 440 for python).
368
+ string runtime_version = 12;
369
+ // Environment root relative to the project root (a venv for python) whose interpreter runs
370
+ // the script. Empty = resolve the interpreter from PATH.
371
+ string env_root = 13;
372
+ // Per-action timeout in milliseconds. 0 = the default (30 minutes).
373
+ int32 timeout_millis = 14;
374
+ // Source config file path (actions.yaml) (generated).
375
+ string file_name = 15;
376
+ }
377
+
344
378
  message Assertion {
345
379
  Target target = 8;
346
380
  Target canonical_target = 13;
@@ -512,6 +546,7 @@ message CompiledGraph {
512
546
  repeated Export exports = 14;
513
547
  repeated Import imports = 16;
514
548
  repeated Extract extracts = 17;
549
+ repeated Script scripts = 18;
515
550
 
516
551
  GraphErrors graph_errors = 7;
517
552
 
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "version": "1.18.0",
37
+ "version": "1.20.0",
38
38
  "name": "@sqlanvil/core",
39
39
  "description": "sqlanvil core API.",
40
40
  "main": "bundle.js"