Data layer restructuring (#997)

* Move query builders to sqlite package
* Add transaction system
* Wrap model resolvers in transaction
* Add error return value for StringSliceToIntSlice
* Update/refactor mutation resolvers
* Convert query builders
* Remove unused join types
* Add stash id unit tests
* Use WAL journal mode
This commit is contained in:
WithoutPants
2021-01-18 12:23:20 +11:00
committed by GitHub
parent 7bae990c67
commit 1e04deb3d4
168 changed files with 12683 additions and 10863 deletions

17
pkg/models/sql.go Normal file
View File

@@ -0,0 +1,17 @@
package models
import "database/sql"
func NullString(v string) sql.NullString {
return sql.NullString{
String: v,
Valid: true,
}
}
func NullInt64(v int64) sql.NullInt64 {
return sql.NullInt64{
Int64: v,
Valid: true,
}
}