Skip to content

Commit

Permalink
Merge pull request #115 from goccy/add-index
Browse files Browse the repository at this point in the history
Add index for metadata tables
  • Loading branch information
goccy authored Dec 8, 2022
2 parents 433c790 + 0075b45 commit 72e84a4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/goccy/go-json v0.10.0
github.com/goccy/go-yaml v1.9.5
github.com/goccy/go-zetasql v0.5.1
github.com/goccy/go-zetasqlite v0.11.5
github.com/goccy/go-zetasqlite v0.11.6
github.com/google/go-cmp v0.5.9
github.com/googleapis/gax-go/v2 v2.7.0
github.com/gorilla/mux v1.8.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ github.com/goccy/go-yaml v1.9.5 h1:Eh/+3uk9kLxG4koCX6lRMAPS1OaMSAi+FJcya0INdB0=
github.com/goccy/go-yaml v1.9.5/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA=
github.com/goccy/go-zetasql v0.5.1 h1:vP9wgUH5gylw8yL+gwO0wF7uW/fW5Dr1AAAzi8Kgevg=
github.com/goccy/go-zetasql v0.5.1/go.mod h1:6W14CJVKh7crrSPyj6NPk4c49L2NWnxvyDLsRkOm4BI=
github.com/goccy/go-zetasqlite v0.11.5 h1:t0H9hYSYcfJBdCd3BRW5Ncb7VWIVEqSIRZq+5Rg2yMU=
github.com/goccy/go-zetasqlite v0.11.5/go.mod h1:C3kQKpgrKo9biit5qd4f5P7WlaCxit72GzFtZm7wznc=
github.com/goccy/go-zetasqlite v0.11.6 h1:C1jzoIHki4VRE2AhEvVU9QpBODmfQNubtALaEOA7GWw=
github.com/goccy/go-zetasqlite v0.11.6/go.mod h1:C3kQKpgrKo9biit5qd4f5P7WlaCxit72GzFtZm7wznc=
github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down
18 changes: 12 additions & 6 deletions internal/metadata/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ var schemata = []string{
CREATE TABLE IF NOT EXISTS projects (
id STRING NOT NULL,
datasetIDs ARRAY<STRING>,
jobIDs ARRAY<STRING>
jobIDs ARRAY<STRING>,
PRIMARY KEY (id)
)`,
`
CREATE TABLE IF NOT EXISTS jobs (
id STRING NOT NULL,
projectID STRING NOT NULL,
metadata STRING,
result STRING,
error STRING
error STRING,
PRIMARY KEY (projectID, id)
)`,
`
CREATE TABLE IF NOT EXISTS datasets (
Expand All @@ -36,28 +38,32 @@ CREATE TABLE IF NOT EXISTS datasets (
tableIDs ARRAY<STRING>,
modelIDs ARRAY<STRING>,
routineIDs ARRAY<STRING>,
metadata STRING
metadata STRING,
PRIMARY KEY (projectID, id)
)`,
`
CREATE TABLE IF NOT EXISTS tables (
id STRING NOT NULL,
projectID STRING NOT NULL,
datasetID STRING NOT NULL,
metadata STRING
metadata STRING,
PRIMARY KEY (projectID, datasetID, id)
)`,
`
CREATE TABLE IF NOT EXISTS models (
id STRING NOT NULL,
projectID STRING NOT NULL,
datasetID STRING NOT NULL,
metadata STRING
metadata STRING,
PRIMARY KEY (projectID, datasetID, id)
)`,
`
CREATE TABLE IF NOT EXISTS routines (
id STRING NOT NULL,
projectID STRING NOT NULL,
datasetID STRING NOT NULL,
metadata STRING
metadata STRING,
PRIMARY KEY (projectID, datasetID, id)
)`,
}

Expand Down

0 comments on commit 72e84a4

Please sign in to comment.