Feat v0.8.3 vector column type (#70)
Some checks failed
CI/CD / detect-changes (pull_request) Successful in 4s
CI/CD / test-frontend (pull_request) Has been skipped
CI/CD / test-runners (pull_request) Has been skipped
CI/CD / e2e-smoke (pull_request) Has been skipped
CI/CD / build-and-deploy (pull_request) Has been cancelled
CI/CD / test-sqlite (pull_request) Has been cancelled
CI/CD / test-go-pg (pull_request) Has been cancelled
Some checks failed
CI/CD / detect-changes (pull_request) Successful in 4s
CI/CD / test-frontend (pull_request) Has been skipped
CI/CD / test-runners (pull_request) Has been skipped
CI/CD / e2e-smoke (pull_request) Has been skipped
CI/CD / build-and-deploy (pull_request) Has been cancelled
CI/CD / test-sqlite (pull_request) Has been cancelled
CI/CD / test-go-pg (pull_request) Has been cancelled
Add vector(N) column type to db_tables manifests with three-tier progressive enhancement: native pgvector on Postgres, JSONB fallback without pgvector, TEXT fallback on SQLite. New db.query_similar() Starlark builtin with dual-path dispatch. - parseVectorDim validates 1..4096 dimensions - mapColType gains hasPgvector parameter for tier selection - HNSW index auto-created on pgvector backends - starlarkToGoValue extended with list→JSON serialization - cosineDistance helper for Go-side fallback computation - ExtensionHandler gains SetCapabilities for install-time DDL - Roadmap updated: v0.8.4 docs refresh + surface sizing fix 13 new tests (5 schema + 8 db module), all passing with -race. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -42,7 +42,7 @@ func TestUpgrade_SchemaAddIndex(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
CreateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "idx-pkg", tables)
|
||||
CreateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "idx-pkg", tables, false)
|
||||
|
||||
// Insert a row
|
||||
physical := extPhysicalTable("idx-pkg", "events")
|
||||
@@ -116,7 +116,7 @@ func TestUpgrade_SchemaAddColumnIdempotent(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
CreateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "idem-pkg", tables)
|
||||
CreateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "idem-pkg", tables, false)
|
||||
|
||||
// Insert a row
|
||||
physical := extPhysicalTable("idem-pkg", "items")
|
||||
@@ -183,7 +183,7 @@ func TestUpgrade_SchemaMultiColumnAdd(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
CreateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "multi-pkg", tables)
|
||||
CreateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "multi-pkg", tables, false)
|
||||
|
||||
// Insert a row
|
||||
physical := extPhysicalTable("multi-pkg", "records")
|
||||
@@ -521,7 +521,7 @@ func TestUpgrade_MigrateExtTables_NewTable(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
changes, err := MigrateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-new", newTables)
|
||||
changes, err := MigrateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-new", newTables, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -559,7 +559,7 @@ func TestUpgrade_MigrateExtTables_AddColumnPreservesRows(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
CreateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-col", tables)
|
||||
CreateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-col", tables, false)
|
||||
|
||||
physical := extPhysicalTable("migrate-col", "records")
|
||||
_, err := database.TestDB.ExecContext(ctx,
|
||||
@@ -574,7 +574,7 @@ func TestUpgrade_MigrateExtTables_AddColumnPreservesRows(t *testing.T) {
|
||||
Columns: map[string]string{"title": "text", "status": "text"},
|
||||
},
|
||||
}
|
||||
changes, err := MigrateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-col", newTables)
|
||||
changes, err := MigrateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-col", newTables, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -626,7 +626,7 @@ func TestUpgrade_MigrateExtTables_IndexIdempotent(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
CreateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-idx", tables)
|
||||
CreateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-idx", tables, false)
|
||||
|
||||
// Migrate with same index — should not fail
|
||||
newTables := map[string]TableDef{
|
||||
@@ -635,13 +635,13 @@ func TestUpgrade_MigrateExtTables_IndexIdempotent(t *testing.T) {
|
||||
Indexes: [][]string{{"category"}},
|
||||
},
|
||||
}
|
||||
_, err := MigrateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-idx", newTables)
|
||||
_, err := MigrateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-idx", newTables, false)
|
||||
if err != nil {
|
||||
t.Fatal("idempotent index migration should not fail:", err)
|
||||
}
|
||||
|
||||
// Run again — still no error
|
||||
_, err = MigrateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-idx", newTables)
|
||||
_, err = MigrateExtTables(ctx, database.TestDB, database.IsPostgres(), stores, "migrate-idx", newTables, false)
|
||||
if err != nil {
|
||||
t.Fatal("second idempotent index migration should not fail:", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user