Skip to content

Commit 53094f5

Browse files
committed
Update deps + reorganize postgres generator folder
1 parent 34d1802 commit 53094f5

23 files changed

Lines changed: 1175 additions & 1408 deletions

Readme.md

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -106,44 +106,12 @@ user.Save(db)
106106

107107
This repository is currently a WIP, features are still not complete and may likely change
108108

109-
Roadmap:
110-
* Handle custom queries for advanced relations (join, aggregations, ...)
111-
* Handle sql enums
112-
* Handle sql views
113-
* Support more types and custom types (cf ulid, ...)
114-
* Support more driver and database Mysql/MariaDB/Sqlite3
115-
* Write benchmark to compare performance with existing Golang ORM
116-
117-
## API
118-
119-
Here is the list of all the auto-generated methods for your tables:
120-
121-
## Getters
122-
* db.{Table}.FindById(id) (*T, error)
123-
* db.{Table}.FindByIds(id) ([]T, error)
124-
* db.{Table}.FindUnique(...filters) (*T, error)
125-
* db.{Table}.FindMany(...filters) ([]T, error)
126-
* db.{Table}.Count(...filters) (int, error)
127-
128-
## Mutations
129-
* db.{Table}.Create(input) (*T, error)
130-
* db.{Table}.CreateMany(inputs) ([]T, error)
131-
* db.{Table}.Update(input) (*T, error)
132-
* db.{Table}.UpdateMany(inputs) ([]T, error)
133-
* db.{Table}.Upsert(input) (*T, error)
134-
* db.{Table}.UpsertMany(inputs) ([]T, error)
135-
* db.{Table}.DeleteSoft(id)
136-
* db.{Table}.DeleteHard(id)
137-
138-
## Query Filters
139-
* db.{Table}.Query.{Field}.Equal(input)
140-
* db.{Table}.Query.{Field}.NotEqual(input)
141-
* db.{Table}.Query.{Field}.In(input)
142-
* db.{Table}.Query.{Field}.NotIn(input)
143-
* db.{Table}.Query.{Field}.Like(input)
144-
* db.{Table}.Query.{Field}.MoreThan(input)
145-
* db.{Table}.Query.{Field}.LessThan(input)
146-
* db.{Table}.Query.{Field}.Between(low, high)
147-
* db.{Table}.Query.Offset(offset)
148-
* db.{Table}.Query.Limit(limit)
149-
* db.{Table}.Query.OrderBy{Field}()
109+
**Roadmap**:
110+
* [x] Handle custom user queries
111+
* [ ] Handle sql enums
112+
* [ ] Handle sql views
113+
* [ ] Support more types and custom types (cf ulid, ...)
114+
* [ ] Support more driver and database Mysql/MariaDB/Sqlite3
115+
* [x] For postgres support both `pq + sqlc` or `pgx`
116+
* [ ] Write benchmark to compare performance with existing Golang ORM
117+
* [x] Wrote basic comparison (insert, bulk insert, select)

devenv.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"devenv": {
44
"locked": {
55
"dir": "src/modules",
6-
"lastModified": 1723238470,
6+
"lastModified": 1723409744,
77
"owner": "cachix",
88
"repo": "devenv",
9-
"rev": "25e48e98c19e9424d517a144db0d31a89536bf94",
10-
"treeHash": "22c7e7b282f50c54cea35da65fd2705f3cb54909",
9+
"rev": "116159a4bfeaa79662f4c39dbfaf2fce6a5737f7",
10+
"treeHash": "ccbae63055f83e669996a88a3cbb4ef69febd002",
1111
"type": "github"
1212
},
1313
"original": {
@@ -72,11 +72,11 @@
7272
},
7373
"nixpkgs-stable": {
7474
"locked": {
75-
"lastModified": 1722987190,
75+
"lastModified": 1723282977,
7676
"owner": "NixOS",
7777
"repo": "nixpkgs",
78-
"rev": "21cc704b5e918c5fbf4f9fff22b4ac2681706d90",
79-
"treeHash": "76c0bca330c9f7c8a68dffa1004146cf49975166",
78+
"rev": "a781ff33ae258bbcfd4ed6e673860c3e923bf2cc",
79+
"treeHash": "75cf71293251c603e56d6076098346b4128b2ec8",
8080
"type": "github"
8181
},
8282
"original": {

go.mod

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,36 @@ require (
88
github.com/gertd/go-pluralize v0.2.1
99
github.com/google/uuid v1.6.0
1010
github.com/iancoleman/strcase v0.3.0
11-
github.com/jackc/pgx/v5 v5.5.5
11+
github.com/jackc/pgx/v5 v5.6.0
1212
github.com/jmoiron/sqlx v1.4.0
1313
github.com/lib/pq v1.10.9
1414
github.com/peterldowns/pgtestdb v0.0.14
1515
github.com/peterldowns/pgtestdb/migrators/goosemigrator v0.0.14
1616
github.com/stretchr/testify v1.9.0
17-
github.com/urfave/cli/v2 v2.27.2
18-
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8
17+
github.com/urfave/cli/v2 v2.27.4
18+
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa
1919
gorm.io/driver/postgres v1.5.9
2020
gorm.io/gorm v1.25.11
2121
)
2222

2323
require (
24-
github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054 // indirect
24+
github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect
2525
github.com/cockroachdb/apd v1.1.1-0.20181017181144-bced77f817b4 // indirect
26-
github.com/cockroachdb/errors v1.8.2 // indirect
27-
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect
28-
github.com/cockroachdb/redact v1.0.8 // indirect
26+
github.com/cockroachdb/errors v1.11.3 // indirect
27+
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
28+
github.com/cockroachdb/redact v1.1.5 // indirect
2929
github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 // indirect
3030
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
3131
github.com/davecgh/go-spew v1.1.1 // indirect
3232
github.com/dustin/go-humanize v1.0.1 // indirect
3333
github.com/getsentry/raven-go v0.2.0 // indirect
34+
github.com/getsentry/sentry-go v0.28.1 // indirect
3435
github.com/gogo/protobuf v1.3.2 // indirect
3536
github.com/golang/protobuf v1.5.4 // indirect
3637
github.com/google/go-cmp v0.6.0 // indirect
3738
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
3839
github.com/jackc/pgpassfile v1.0.0 // indirect
39-
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
40+
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
4041
github.com/jackc/puddle/v2 v2.2.1 // indirect
4142
github.com/jinzhu/inflection v1.0.0 // indirect
4243
github.com/jinzhu/now v1.1.5 // indirect
@@ -48,22 +49,22 @@ require (
4849
github.com/pkg/errors v0.9.1 // indirect
4950
github.com/pmezard/go-difflib v1.0.0 // indirect
5051
github.com/pressly/goose/v3 v3.21.1 // indirect
51-
github.com/rogpeppe/go-internal v1.10.0 // indirect
52+
github.com/rogpeppe/go-internal v1.12.0 // indirect
5253
github.com/russross/blackfriday/v2 v2.1.0 // indirect
53-
github.com/sethvargo/go-retry v0.2.4 // indirect
54+
github.com/sethvargo/go-retry v0.3.0 // indirect
5455
github.com/sirupsen/logrus v1.9.3 // indirect
5556
github.com/spf13/pflag v1.0.5 // indirect
56-
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
57+
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
5758
go.uber.org/multierr v1.11.0 // indirect
58-
golang.org/x/crypto v0.24.0 // indirect
59-
golang.org/x/net v0.26.0 // indirect
60-
golang.org/x/sync v0.7.0 // indirect
61-
golang.org/x/sys v0.21.0 // indirect
62-
golang.org/x/text v0.16.0 // indirect
63-
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
64-
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect
65-
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
66-
google.golang.org/grpc v1.59.0 // indirect
59+
golang.org/x/crypto v0.26.0 // indirect
60+
golang.org/x/net v0.27.0 // indirect
61+
golang.org/x/sync v0.8.0 // indirect
62+
golang.org/x/sys v0.24.0 // indirect
63+
golang.org/x/text v0.17.0 // indirect
64+
google.golang.org/genproto v0.0.0-20240808171019-573a1156607a // indirect
65+
google.golang.org/genproto/googleapis/api v0.0.0-20240808171019-573a1156607a // indirect
66+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240808171019-573a1156607a // indirect
67+
google.golang.org/grpc v1.65.0 // indirect
6768
google.golang.org/protobuf v1.34.2 // indirect
6869
gopkg.in/yaml.v3 v3.0.1 // indirect
6970
)

0 commit comments

Comments
 (0)