Compare commits
2 Commits
c08f12e275
...
e85a68e69d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e85a68e69d | ||
|
|
eee6714918 |
14
doc/TODO.txt
14
doc/TODO.txt
@ -15,3 +15,17 @@ TODO: generator-foreign-keys
|
|||||||
TODO: migration-structs
|
TODO: migration-structs
|
||||||
- Right now, migrations are strings. Could be a struct with "name", "up" and "down" fields
|
- Right now, migrations are strings. Could be a struct with "name", "up" and "down" fields
|
||||||
- Adding a "down" operation enables handling newer DB versions with "down instead of error-out" for development (perhaps a flag)
|
- Adding a "down" operation enables handling newer DB versions with "down instead of error-out" for development (perhaps a flag)
|
||||||
|
|
||||||
|
IDEA: migrations-table
|
||||||
|
- Store migrations in a table. This makes the schema more self-documenting.
|
||||||
|
- Possible schema: name, sql_up, sql_down, hash (computed from those fields plus previous migration hash)
|
||||||
|
- or just rowid instead of hash? Migration sequence should be immutable after publishing, so there should never be "conflicts"
|
||||||
|
|
||||||
|
TODO: language-server-for-TODO.txt
|
||||||
|
|
||||||
|
TODO: auto-migration-checker
|
||||||
|
- Use `pkg/schema` to test whether a base schema plus a migration equals a new schema
|
||||||
|
|
||||||
|
TODO: codegen `without rowid` tables properly
|
||||||
|
|
||||||
|
TODO: generated test file inclues global test DB setup, which is wrong
|
||||||
|
|||||||
@ -10,6 +10,8 @@ RUN apk add less
|
|||||||
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v2.0.2
|
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v2.0.2
|
||||||
RUN GOBIN=/usr/local/bin go install git.offline-twitter.com/offline-labs/gocheckout@v0.0.2
|
RUN GOBIN=/usr/local/bin go install git.offline-twitter.com/offline-labs/gocheckout@v0.0.2
|
||||||
|
|
||||||
|
COPY etc/group /etc/group
|
||||||
|
|
||||||
# Create a user in the container with the same UID as on the host machine, to avoid ownership conflicts.
|
# Create a user in the container with the same UID as on the host machine, to avoid ownership conflicts.
|
||||||
# The user gets sudo of course.
|
# The user gets sudo of course.
|
||||||
#
|
#
|
||||||
|
|||||||
3
ops/devcontainer/etc/group
Normal file
3
ops/devcontainer/etc/group
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
root:x:0:
|
||||||
|
nogroup:x:65533:
|
||||||
|
nobody:x:65534:
|
||||||
@ -52,7 +52,7 @@ func GenerateModelAST(table schema.Table) *ast.GenDecl {
|
|||||||
} else if strings.HasSuffix(col.Name, "_at") {
|
} else if strings.HasSuffix(col.Name, "_at") {
|
||||||
typeName = "Timestamp"
|
typeName = "Timestamp"
|
||||||
} else {
|
} else {
|
||||||
typeName = "int64"
|
typeName = "int"
|
||||||
}
|
}
|
||||||
case "text":
|
case "text":
|
||||||
typeName = "string"
|
typeName = "string"
|
||||||
@ -258,12 +258,12 @@ func GenerateGetAllItemsFunc(tbl schema.Table) *ast.FuncDecl {
|
|||||||
&ast.UnaryExpr{Op: token.AND, X: ast.NewIdent("ret")},
|
&ast.UnaryExpr{Op: token.AND, X: ast.NewIdent("ret")},
|
||||||
&ast.BinaryExpr{
|
&ast.BinaryExpr{
|
||||||
X: &ast.BinaryExpr{
|
X: &ast.BinaryExpr{
|
||||||
X: &ast.BasicLit{Kind: token.STRING, Value: "`SELECT `"},
|
X: &ast.BasicLit{Kind: token.STRING, Value: "`select `"},
|
||||||
Op: token.ADD,
|
Op: token.ADD,
|
||||||
Y: SQLFieldsConstIdent(tbl),
|
Y: SQLFieldsConstIdent(tbl),
|
||||||
},
|
},
|
||||||
Op: token.ADD,
|
Op: token.ADD,
|
||||||
Y: &ast.BasicLit{Kind: token.STRING, Value: "` FROM " + tbl.TableName + "`"},
|
Y: &ast.BasicLit{Kind: token.STRING, Value: "` from " + tbl.TableName + "`"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user