crud
English | 机翻中文
Crud is a golang package that helps writing CRUD servers. With this package, all you need is models, while all the rest is done for you automatically.
Get started
- get the package:
go get -u github.com/cdfmlr/crud
- all you need are models, and register them in orm & router:
package main
import (
"github.com/cdfmlr/crud/orm"
"github.com/cdfmlr/crud/router"
)
type Todo struct {
orm.BasicModel
Title string `json:"title"`
Detail string `json:"detail"`
Done bool `json:"done"`
}
type Project struct {
orm.BasicModel
Title string `json:"title"`
Todos []*Todo `json:"todos" gorm:"many2many:project_todos"`
}
func main() {
orm.ConnectDB(orm.DBDriverSqlite, "todolist.db")
orm.RegisterModel(Todo{}, Project{})
r := router.NewRouter()
router.Crud[Todo](r, "/todos")
router.Crud[Project](r, "/projects",
router.CrudNested[Project, Todo]("todos"),
)
r.Run(":8086")
}
These 32 lines of code make it an available RESTful API service with 13 endpoints:
# api to todos
GET /todos
GET /todos/:TodoID
POST /todos
PUT /todos/:TodoID
DELETE /todos/:TodoID
# api to projects
GET /projects
GET /projects/:ProjectID
POST /projects
PUT /projects/:ProjectID
DELETE /projects/:ProjectID
# api to nested todos in a project
GET /projects/:ProjectID/todos
POST /projects/:ProjectID/todos
DELETE /projects/:ProjectID/todos/:TodoID
Let's explain it.
orm
crud/orm
is an ORM package works as crud's DAO layer. It's a wrapper of GORM with responsibility for database connection and auto migrate.
orm.ConnectDB
is used to connect to a database. It's a wrapper of gorm.Open
. And orm.RegisterModel
is used to register your models, which calls gorm.AutoMigrate
to build the tables.
orm
package also defines a Model
interface. Crud can only automatically generate CRUD services for models that implement this interface. orm.BasicModel
is a basic implementation of this interface. It's a wrapper of gorm.Model
, which defines an auto-incrementing primary key and soft delete support:
type BasicModel struct {
ID uint `gorm:"primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time `sql:"index"`
}
In most cases, you can just embed orm.BasicModel
to your model. It's a good starting point.
router
crud/router
is a package that helps you to generate CRUD services based on gin.
It provides a router.NewRouter()
function to create a new gin router.
And the magic is router.Crud[Todo](r, "/todos")
, that will automatically make REST APIs to the model Todo
at relative path /todos
:
GET /todos # get todos list
GET /todos/:id # get a todo by id
POST /todos # create a new todo record
{
"title": "clean my room"
}
PUT /todos/:id # update a todo record
{
"done": true
}
DELETE /todos/:id # delete a todo record
BTW, the type parameter Todo
is required. It's not inferable for the compiler.
router.CrudNested[Project, Todo]("todos")
will create nested APIs to the model Todo
in the model Project
, that is, CRUD for the Project.Todos
field:
GET /projects/:ProjectID/todos # get associated todos list
POST /projects/:ProjectID/todos # create new associated relationship
{
"title": "clean my kitchen"
"detail": "rm -rf bin; mv cooktop/* cupboard"
}
DELETE /projects/:ProjectID/todos/:TodoID # delete an associated relationship
Next steps
For an extremely simple project, like todolist above, using crud/orm
and crud/router
together is enough to make API jobs done. But for a more real-world case, you may want to use lower level parts of crud
to build your own CRUD API services:
crud/controller
: Package controller implements model based generic CRUD controllers (i.e. http handlers) to handle create / read / update / delete requests from http clients.crud/service
: Package service implements the basic CRUD operations for models.crud/config
is a package that helps you to read configuration into a structure based "ConfigModel". It's a wrapper of vipercrud/log
is a package that helps you to log your application. It's a wrapper of logrus
Documents:
Examples:
- sshman is a more real world example of how crud can help you build a CRUD REST API project fast and easily. Please check it out.
How it works
The implementation of crud is inspired by the layered MVC architecture:
Layer | Description |
---|---|
router | define REST APIs |
controller | handles the HTTP requests (GET/POST/PUT/DELETE) |
service | business logic (Create/Read/Update/Delete) |
orm | DAO: R/Ws to the database |
Each layer is a package. And with generics and reflection in Go, crud achieves generic implementations for each layer.
TODOs
- tests for services and controllers
- updates depended Gin/GORM/... packages automaticly (dependabot)
- ...
MIT License
Copyright (c) 2022 CDFMLR
build(deps): bump gorm.io/gorm from 1.23.8 to 1.24.2
Bumps gorm.io/gorm from 1.23.8 to 1.24.2.
Commits
342310f
fix(FindInBatches): throw err if pk not exists (#5868)b6836c2
fix bug in windows (#5844)cef3de6
cleanup(prepare_stmt.go): unnecessary map delete (#5849)1b9cd56
doc(README.md): add contributors (#5847)871f1de
fix logger path bug (#5836)fb640cf
test(utils): add utils unit test (#5834)5c8ecc3
feat: golangci add goimports and whitespace (#5835)f82e9cf
test(clause/joins): add join unit test (#5832)b2f4252
fix(Joins): args with select and omit (#5790)9d82aa5
test: invalid cache plan with prepare stmt (#5778)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/driver/mysql from 1.3.6 to 1.4.4
Bumps gorm.io/driver/mysql from 1.3.6 to 1.4.4.
Commits
4a51687
remove unnecessary judgments and fix misspellings (#95)ae06135
feat: gen multi database (#96)ca4edc1
Fix convert time to local panic when time is nilc538c38
Disable Returning for mariadb < 10.5, close #93bf5c03d
opt time value display the debug sql (#92)ecb6c6a
Enable WithReturning by default for MariaDB, close #62, #85ff88afd
feat: support type alias (#90)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/gorm from 1.23.8 to 1.24.1
Bumps gorm.io/gorm from 1.23.8 to 1.24.1.
Commits
b2f4252
fix(Joins): args with select and omit (#5790)9d82aa5
test: invalid cache plan with prepare stmt (#5778)5dd2bb4
feat(PreparedStmtDB): support reset (#5782)3f20a54
Support use clause.Interface as query params62593cf
add test: TestAutoMigrateInt8PG: shouldn't execute ALTER COLUMN TYPE smallint...a0f4d3f
Save as empty string for not nullable nil field serialized into jsonab5f80a
Save as NULL for nil object serialized into json186e8a9
fix: association without pks (#5779)2a788fb
Upgrade tests go.modaa4312e
Don't display any GORM related package path as sourceDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/driver/postgres from 1.3.9 to 1.4.5
Bumps gorm.io/driver/postgres from 1.3.9 to 1.4.5.
Commits
35e3f98
fix: reset prepared stmts when table changed (#138)e6551c7
Fix autoincrement check, close #88d3403e4
Allow disable returning from dialector config, close #880d0e3a2
Fix possible panic when comment not quoted, close #134af97cb4
Fix migrate columns with default valuea4858c5
add USING ?::? toAlterColumn
(#105)096c357
Only enable simple protocal for pgxe6ed2df
AutoMigrate fails withsql: expected 0 arguments, got 1
(#131)6145461
feat: support type alias (#133)9e7a2bb
fix: use oid replace relfilenode in check column type (#129)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/driver/sqlite from 1.3.6 to 1.4.3
Bumps gorm.io/driver/sqlite from 1.3.6 to 1.4.3.
Commits
22036f5
Fix condition for limit (#5735) (#118)1007940
Include pure go sqlite driver in README, close #77 #93c86933b
Fix parse ddl with newline, close #94455504f
Fix index ddl regexp, close #872573b11
ignore generated columns when [recreateTable] (#109)d13f96d
Update github action go versionea59bcf
Fix change limit.Limit typefd61679
Bump github.com/mattn/go-sqlite3 from 1.14.12 to 1.14.15 (#108)2609fe6
fix: limit=0 results (#5735) (#114)7c8ddee
Fix testsDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/driver/mysql from 1.3.6 to 1.4.3
Bumps gorm.io/driver/mysql from 1.3.6 to 1.4.3.
Commits
ca4edc1
Fix convert time to local panic when time is nilc538c38
Disable Returning for mariadb < 10.5, close #93bf5c03d
opt time value display the debug sql (#92)ecb6c6a
Enable WithReturning by default for MariaDB, close #62, #85ff88afd
feat: support type alias (#90)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/driver/sqlite from 1.3.6 to 1.4.2
Bumps gorm.io/driver/sqlite from 1.3.6 to 1.4.2.
Commits
1007940
Include pure go sqlite driver in README, close #77 #93c86933b
Fix parse ddl with newline, close #94455504f
Fix index ddl regexp, close #872573b11
ignore generated columns when [recreateTable] (#109)d13f96d
Update github action go versionea59bcf
Fix change limit.Limit typefd61679
Bump github.com/mattn/go-sqlite3 from 1.14.12 to 1.14.15 (#108)2609fe6
fix: limit=0 results (#5735) (#114)7c8ddee
Fix testsDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/driver/postgres from 1.3.9 to 1.4.4
Bumps gorm.io/driver/postgres from 1.3.9 to 1.4.4.
Commits
e6551c7
Fix autoincrement check, close #88d3403e4
Allow disable returning from dialector config, close #880d0e3a2
Fix possible panic when comment not quoted, close #134af97cb4
Fix migrate columns with default valuea4858c5
add USING ?::? toAlterColumn
(#105)096c357
Only enable simple protocal for pgxe6ed2df
AutoMigrate fails withsql: expected 0 arguments, got 1
(#131)6145461
feat: support type alias (#133)9e7a2bb
fix: use oid replace relfilenode in check column type (#129)56e9b94
fix cockroachdb index name inspection (#122)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/driver/mysql from 1.3.6 to 1.4.1
Bumps gorm.io/driver/mysql from 1.3.6 to 1.4.1.
Commits
ecb6c6a
Enable WithReturning by default for MariaDB, close #62, #85ff88afd
feat: support type alias (#90)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/gorm from 1.23.8 to 1.24.0
Bumps gorm.io/gorm from 1.23.8 to 1.24.0.
Commits
34fbe84
Add TableName with NamingStrategy support, close #5726e8f48b5
fix: limit=0 results (#5735) (#5736)4b22a55
fix: primaryFields are overwritten (#5721)9564b82
Fix OnConstraint builder (#5738)0b7113b
fix: prepare deadlock (#5568)a3cc6c6
Fix: wrong value when Find with Join with same column name, close #5723, #5711be440e7
fix possible nil panic in tests (#5720)e1dd0dc
chore(deps): bump actions/stale from 5 to 6 (#5717)328f301
add some test case which related the logic (#5477)1223745
fix: use preparestmt in trasaction will use new conn, close #5508Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/gorm from 1.23.8 to 1.23.10
Bumps gorm.io/gorm from 1.23.8 to 1.23.10.
Commits
328f301
add some test case which related the logic (#5477)1223745
fix: use preparestmt in trasaction will use new conn, close #550873bc53f
feat: migrator support type aliases (#5627)101a7c7
fix: scan array (#5624)3a72ba1
Allow shared foreign key for many2many jointable1f634c3
support scan assign slice cap (#5634)5ed7b1a
fix: same embedded filed name (#5705)4906259
fix: update omit (#5699)edb00c1
AutoMigrate() should always migrate checks, even there is no relationship con...f29afdd
Rewrite of finisher_api Godocs (#5618)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/driver/sqlite from 1.3.6 to 1.4.4
Bumps gorm.io/driver/sqlite from 1.3.6 to 1.4.4.
Commits
7f4b498
Fix get column default value for null column22036f5
Fix condition for limit (#5735) (#118)1007940
Include pure go sqlite driver in README, close #77 #93c86933b
Fix parse ddl with newline, close #94455504f
Fix index ddl regexp, close #872573b11
ignore generated columns when [recreateTable] (#109)d13f96d
Update github action go versionea59bcf
Fix change limit.Limit typefd61679
Bump github.com/mattn/go-sqlite3 from 1.14.12 to 1.14.15 (#108)2609fe6
fix: limit=0 results (#5735) (#114)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/driver/postgres from 1.3.9 to 1.4.6
Bumps gorm.io/driver/postgres from 1.3.9 to 1.4.6.
Commits
d857acc
Fix alter column with default value1dd9747
[CockroachDB] Fixing how it handle fields DEFAULT values and column types (#143)915abc3
Disable add existing constraint (#145)1d65db6
fix migrator default value regexp (#148)4343642
fix: receiver names of dialector are different (#149)6629ecf
Bump github.com/jackc/pgx/v5 from 5.0.4 to 5.2.0 (#150)321c8fd
Upgrade pgx driver, close #1395eb6308
Upgrade go.mod, close #14035e3f98
fix: reset prepared stmts when table changed (#138)e6551c7
Fix autoincrement check, close #88Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/gorm from 1.23.8 to 1.24.3
Bumps gorm.io/gorm from 1.23.8 to 1.24.3.
Commits
4b768c8
Upgrade tests deps16a2722
fix(migrator): Tag default:'null' always causes field migration #5953 (#5954)da2b286
fix(migrator): ignore relationships when migrating #5913 (#5946)7da24d1
chore(deps): bump actions/stale from 6 to 7 (#5945)ddd3cc2
Add ParameterizedQueries option support for logger, close #5288794edad
test(MigrateColumn): mock alter column to improve field compare (#5499)1935eb0
feat: support inner join (#5583)775fa70
DryRun for migrator (#5689)bbd2bbe
fix:Issue migrating field with CURRENT_TIMESTAMP (#5906)f3c6fc2
Update func comments in chainable_api and FirstOr_ (#5935)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump gorm.io/driver/mysql from 1.3.6 to 1.4.5
Bumps gorm.io/driver/mysql from 1.3.6 to 1.4.5.
Commits
332829e
Display time in configured time zone in DSN, close github.com/go-gorm/gorm/is...aecc70d
Bump github.com/go-sql-driver/mysql from 1.6.0 to 1.7.0 (#99)7746e77
Update migrator.go (#100)4a51687
remove unnecessary judgments and fix misspellings (#95)ae06135
feat: gen multi database (#96)ca4edc1
Fix convert time to local panic when time is nilc538c38
Disable Returning for mariadb < 10.5, close #93bf5c03d
opt time value display the debug sql (#92)ecb6c6a
Enable WithReturning by default for MariaDB, close #62, #85ff88afd
feat: support type alias (#90)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump actions/dependency-review-action from 2 to 3
Bumps actions/dependency-review-action from 2 to 3.
Release notes
Sourced from actions/dependency-review-action's releases.
... (truncated)
Commits
30d5821
Bumping version number6e42c33
Remove defaults from the recently added fields.a3074cd
Merge pull request #327 from actions/adding-extra-options51a29d6
Updating action.yml to include*-check
config235a221
Merge pull request #324 from actions/readme-update9b3a7f6
Minor README tweaks.a476131
Addpull_request
to the list of events that don't need refs.28c7c8c
Set the correct default for license-check in README.9da0fd4
Merge pull request #325 from actions/dependabot/npm_and_yarn/eslint-plugin-je...fe45fd6
Merge pull request #326 from actions/dependabot/npm_and_yarn/esbuild-register...Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)build(deps): bump github.com/gofrs/uuid from 4.2.0+incompatible to 4.3.1+incompatible
Bumps github.com/gofrs/uuid from 4.2.0+incompatible to 4.3.1+incompatible.
Release notes
Sourced from github.com/gofrs/uuid's releases.
Commits
e1079f3
Use legacy go versions compatible unix millisecond calculation (#104)e420387
Enhance defaultHWAddrFunc() and tests to hit 100% coverage (#57)f267b3d
update UUIDv7 implementation with RFC Draft Rev 03 spec (#99)edd511b
update build to use go 1.19 as primary (#103)1e02a1d
Update go.yml to use go 1.18 (#102)028e840
update readme to document experimental v6 and v7 ids (#94)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)