@sqlanvil/core 1.17.1 → 1.19.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
@@ -107,8 +107,9 @@ message Environment {
107
107
  // A named connection: the warehouse (read/write target) or a read-only source.
108
108
  message ConnectionConfig {
109
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
+ // MySQL/MariaDB sources are runner-extract only (no Postgres FDW for MySQL): the CLI reads
111
+ // the source at run time and materializes it into the write warehouse. `sqlanvil introspect`
112
+ // scaffolds declarations (columnTypes) from a MySQL source.
112
113
  string platform = 1;
113
114
  // Optional. BigQuery source default project.
114
115
  string project = 2;
@@ -121,19 +122,20 @@ message ConnectionConfig {
121
122
  // (e.g. `bigquery-public-data`): the FDW server's `project_id` becomes the billing
122
123
  // project and the foreign table reads the source via a full-FQN subquery.
123
124
  string billing_project = 9;
124
- // Optional. Postgres source host (non-secret; password lives in .df-credentials.json).
125
+ // Optional. Postgres/MySQL source host (non-secret; password lives in .df-credentials.json).
125
126
  string host = 5;
126
- // Optional. Postgres source port.
127
+ // Optional. Postgres/MySQL source port.
127
128
  uint32 port = 6;
128
- // Optional. Postgres source database name.
129
+ // Optional. Postgres/MySQL source database name.
129
130
  string database = 7;
130
131
  // Optional. Postgres/Supabase default schema.
131
132
  string default_schema = 8;
132
133
  // Optional. Source read mode for a cross-warehouse source connection:
133
- // "fdw" (default) — a live foreign-data-wrapper table (needs the Vault secret + wrappers).
134
- // "runner-extract" — the CLI reads the source directly at run time and materializes the rows
135
- // into a plain table (keyless; no Vault secret, no wrappers/postgis on the branch). BigQuery
136
- // only for now. See the runner-extract action.
134
+ // "fdw" (default for bigquery/postgres/supabase) — a live foreign-data-wrapper table (needs
135
+ // the Vault secret + wrappers).
136
+ // "runner-extract" (default and only mode for mysql; also supported for bigquery) — the CLI
137
+ // reads the source directly at run time and materializes the rows into a plain table
138
+ // (keyless; no Vault secret, no wrappers/postgis on the branch). See the extract action.
137
139
  string mode = 10;
138
140
  }
139
141
 
@@ -449,6 +451,11 @@ message ActionConfig {
449
451
  // ("on_dependency_change" → in-place REFRESH instead of drop+recreate)
450
452
  // apply; indexes also apply to materialized views.
451
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;
452
459
  }
453
460
 
454
461
  enum OnSchemaChange {
@@ -1089,9 +1096,8 @@ message PostgresOptions {
1089
1096
  string refresh_policy = 7;
1090
1097
  }
1091
1098
 
1092
- // MySQL/MariaDB table options + secondary indexes. First cut: engine/charset/
1093
- // collation and plain/unique secondary indexes. (No partitioning, FULLTEXT/
1094
- // SPATIAL/prefix indexes, or row_format yet — those are later follow-ups.)
1099
+ // MySQL/MariaDB table options, secondary indexes (plain/unique/fulltext/spatial,
1100
+ // with optional per-column prefix lengths), row_format, and native partitioning.
1095
1101
  message MysqlOptions {
1096
1102
  // Storage engine, emitted as ENGINE=<engine> (e.g. "InnoDB", "MyISAM").
1097
1103
  // Omit to use the server default.
@@ -1100,13 +1106,24 @@ message MysqlOptions {
1100
1106
  string charset = 2;
1101
1107
  // Default collation, emitted as COLLATE=<collation> (e.g. "utf8mb4_unicode_ci").
1102
1108
  string collation = 3;
1109
+ // Row format, emitted as ROW_FORMAT=<row_format> (e.g. "DYNAMIC", "COMPRESSED",
1110
+ // "COMPACT", "REDUNDANT"). Omit to use the engine default.
1111
+ string row_format = 6;
1103
1112
 
1104
1113
  message Index {
1105
1114
  // Optional; when omitted, derived as <table>_<cols>_idx (or _key if unique),
1106
1115
  // capped at 63 chars.
1107
1116
  string name = 1;
1117
+ // Column names. A column may carry a prefix length in MySQL's own syntax —
1118
+ // "description(50)" — emitted as `description`(50) (required to index BLOB/TEXT,
1119
+ // optional elsewhere).
1108
1120
  repeated string columns = 2;
1109
1121
  bool unique = 3;
1122
+ // Index type: "" (default B-tree/engine default), "fulltext", or "spatial".
1123
+ // Mutually exclusive with `unique`. NB a SPATIAL index requires a NOT NULL
1124
+ // SRID-attributed geometry column — CTAS-created columns are nullable, so
1125
+ // spatial usually needs an `ALTER TABLE ... MODIFY` pre-step in post_operations.
1126
+ string type = 4;
1110
1127
  }
1111
1128
  repeated Index indexes = 4;
1112
1129
 
package/core.proto CHANGED
@@ -324,7 +324,7 @@ message Extract {
324
324
  // The named connection this source reads through (keys into .df-credentials.json `connections`
325
325
  // for the per-connection access token / key).
326
326
  string connection_name = 8;
327
- // Source platform ("bigquery").
327
+ // Source platform ("bigquery" or "mysql").
328
328
  string platform = 9;
329
329
  // Source project + dataset + object name (BigQuery reads `project.dataset.source_name`).
330
330
  string project = 10;
@@ -336,6 +336,9 @@ message Extract {
336
336
  map<string, string> column_types = 14;
337
337
  // Source .sqlx file path (generated).
338
338
  string file_name = 15;
339
+ // Source database for platforms whose namespace is a database (MySQL reads
340
+ // `database.source_name`).
341
+ string database = 16;
339
342
  }
340
343
 
341
344
  message Assertion {
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "version": "1.17.1",
37
+ "version": "1.19.0",
38
38
  "name": "@sqlanvil/core",
39
39
  "description": "sqlanvil core API.",
40
40
  "main": "bundle.js"