A package helps writing CRUD servers. All you need is this package and models.

  • By CDFMLR
  • Last update: Nov 26, 2022
  • Comments: 17

header-image

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.

crud = GORM + Gin + Logrus + Viper + automatic CRUD service

Get started

  1. get the package:
go get -u github.com/cdfmlr/crud
  1. 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 viper
  • crud/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:

curd 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

Download

crud.zip

Comments(17)

  • 1

    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

    Dependabot compatibility score

    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)
  • 2

    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

    Dependabot compatibility score

    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)
  • 3

    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 params
    • 62593cf add test: TestAutoMigrateInt8PG: shouldn't execute ALTER COLUMN TYPE smallint...
    • a0f4d3f Save as empty string for not nullable nil field serialized into json
    • ab5f80a Save as NULL for nil object serialized into json
    • 186e8a9 fix: association without pks (#5779)
    • 2a788fb Upgrade tests go.mod
    • aa4312e Don't display any GORM related package path as source
    • Additional commits viewable in compare view

    Dependabot compatibility score

    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)
  • 4

    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 #88
    • d3403e4 Allow disable returning from dialector config, close #88
    • 0d0e3a2 Fix possible panic when comment not quoted, close #134
    • af97cb4 Fix migrate columns with default value
    • a4858c5 add USING ?::? to AlterColumn (#105)
    • 096c357 Only enable simple protocal for pgx
    • e6ed2df AutoMigrate fails with sql: expected 0 arguments, got 1 (#131)
    • 6145461 feat: support type alias (#133)
    • 9e7a2bb fix: use oid replace relfilenode in check column type (#129)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    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)
  • 5

    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

    Dependabot compatibility score

    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)
  • 6

    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

    Dependabot compatibility score

    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)
  • 7

    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

    Dependabot compatibility score

    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)
  • 8

    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 #88
    • d3403e4 Allow disable returning from dialector config, close #88
    • 0d0e3a2 Fix possible panic when comment not quoted, close #134
    • af97cb4 Fix migrate columns with default value
    • a4858c5 add USING ?::? to AlterColumn (#105)
    • 096c357 Only enable simple protocal for pgx
    • e6ed2df AutoMigrate fails with sql: 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)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    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)
  • 9

    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

    Dependabot compatibility score

    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)
  • 10

    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

    Dependabot compatibility score

    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)
  • 11

    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

    Dependabot compatibility score

    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)
  • 12

    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

    Dependabot compatibility score

    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)
  • 13

    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

    Dependabot compatibility score

    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)
  • 14

    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

    Dependabot compatibility score

    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)
  • 15

    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 nil
    • c538c38 Disable Returning for mariadb < 10.5, close #93
    • bf5c03d opt time value display the debug sql (#92)
    • ecb6c6a Enable WithReturning by default for MariaDB, close #62, #85
    • ff88afd feat: support type alias (#90)
    • See full diff in compare view

    Dependabot compatibility score

    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)
  • 16

    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.

    3.0.0

    Breaking Changes

    By default the action now expects SPDX-compliant licenses everywhere. If you were previously using license names in the allow or deny lists make sure they're valid!

    What's Changed

    Support for external configuration files

    You can now specify a configuration file external to your repository. This allows organizations to have a single configuration file for all their repos.

    Broader license support

    We've added support for a much broader set of project licenses by using GitHub's Licenses API.

    SPDX Compliance

    All of our license-related code now expects SPDX-compliant licenses or expressions. This allows us to standardize on a license naming scheme that already supports OR/AND expressions.

    Disable individual checks

    You can now use the boolean options license-check and vulnerability-check to disable either one of the checks. More information in our configuration options.

    Thanks

    Contributors for this release include:

    Thanks everyone! Full Changelog: https://github.com/actions/dependency-review-action/compare/v2...v3.0.0

    2.5.1

    Adding some quality-of-life improvements to the local development experience. You can now pass a flag to the scripts/scan_pr script using the -c/--config-file flags to use an external configuration file:

    Example:

      scripts/scan_pr https://github.com/actions/dependency-review-action/pull/294
    

    2.5.0

    Fallback on GitHub Licenses API data for missing Dependency Review API Licenses. This should improve our license coverage.

    2.4.1

    This patch release fixes the bugs below:

    • Display the dependency name instead of the manifest name in the detailed list of dependents.
    • Fix an issue where undefined GHSAs would remove filter out all changes.

    ... (truncated)

    Commits
    • 30d5821 Bumping version number
    • 6e42c33 Remove defaults from the recently added fields.
    • a3074cd Merge pull request #327 from actions/adding-extra-options
    • 51a29d6 Updating action.yml to include *-check config
    • 235a221 Merge pull request #324 from actions/readme-update
    • 9b3a7f6 Minor README tweaks.
    • a476131 Add pull_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...
    • Additional commits viewable in compare view

    Dependabot compatibility score

    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)
  • 17

    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.

    v4.3.1

    • Update UUIDv7 to use unix millisecond calculation that is friendly to legacy go versions by @​convto Full Changelog: v4.3.0...v4.3.1

    Update to UUIDv7

    Full Changelog: v4.2.0...v4.3.0

    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)
    • See full diff in compare view

    Dependabot compatibility score

    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)