2020-09-30 17:38:28 +01:00
|
|
|
#!/bin/sh
|
2021-06-01 08:06:53 +01:00
|
|
|
set -e pipefail
|
2021-02-04 14:38:45 +00:00
|
|
|
|
|
|
|
dbx schema -d pgx -d sqlite3 multinodedb.dbx .
|
2023-09-08 15:28:46 +01:00
|
|
|
dbx golang -d pgx -d sqlite3 --rx=false -p dbx -t templates multinodedb.dbx .
|
2021-04-28 02:30:01 +01:00
|
|
|
|
2023-02-17 12:58:26 +00:00
|
|
|
( printf '%s\n' '//lint:file-ignore U1000,ST1012,SA1019 generated file'; cat multinodedb.dbx.go ) > multinodedb.dbx.go.tmp && mv multinodedb.dbx.go.tmp multinodedb.dbx.go
|
2020-09-30 17:38:28 +01:00
|
|
|
gofmt -r "*sql.Tx -> tagsql.Tx" -w multinodedb.dbx.go
|
|
|
|
gofmt -r "*sql.Rows -> tagsql.Rows" -w multinodedb.dbx.go
|
|
|
|
perl -0777 -pi \
|
2021-02-04 14:38:45 +00:00
|
|
|
-e 's,\t"fmt"\n,\t"fmt"\n\t"math/rand"\n,' \
|
|
|
|
multinodedb.dbx.go
|
|
|
|
perl -0777 -pi \
|
2021-04-23 10:52:40 +01:00
|
|
|
-e 's,\t"math/rand"\n\),\n\t"storj.io/private/tagsql"\n\),' \
|
2020-09-30 17:38:28 +01:00
|
|
|
multinodedb.dbx.go
|
|
|
|
perl -0777 -pi \
|
|
|
|
-e 's/type DB struct \{\n\t\*sql\.DB/type DB struct \{\n\ttagsql.DB/' \
|
|
|
|
multinodedb.dbx.go
|
|
|
|
perl -0777 -pi \
|
|
|
|
-e 's/\tdb = &DB\{\n\t\tDB: sql_db,/\tdb = &DB\{\n\t\tDB: tagsql.Wrap\(sql_db\),/' \
|
|
|
|
multinodedb.dbx.go
|