forked from ALHP/ALHP.GO
updated deps; minor fixed; ent regen
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package ent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
@@ -58,7 +59,7 @@ func Open(driverName, dataSourceName string, options ...Option) (*Client, error)
|
||||
// is used until the transaction is committed or rolled back.
|
||||
func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
if _, ok := c.driver.(*txDriver); ok {
|
||||
return nil, fmt.Errorf("ent: cannot start a transaction within a transaction")
|
||||
return nil, errors.New("ent: cannot start a transaction within a transaction")
|
||||
}
|
||||
tx, err := newTx(ctx, c.driver)
|
||||
if err != nil {
|
||||
@@ -76,7 +77,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
// BeginTx returns a transactional client with specified options.
|
||||
func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {
|
||||
if _, ok := c.driver.(*txDriver); ok {
|
||||
return nil, fmt.Errorf("ent: cannot start a transaction within a transaction")
|
||||
return nil, errors.New("ent: cannot start a transaction within a transaction")
|
||||
}
|
||||
tx, err := c.driver.(interface {
|
||||
BeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)
|
||||
@@ -99,7 +100,6 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
|
||||
// DbPackage.
|
||||
// Query().
|
||||
// Count(ctx)
|
||||
//
|
||||
func (c *Client) Debug() *Client {
|
||||
if c.debug {
|
||||
return c
|
||||
@@ -138,7 +138,7 @@ func (c *DbPackageClient) Use(hooks ...Hook) {
|
||||
c.hooks.DbPackage = append(c.hooks.DbPackage, hooks...)
|
||||
}
|
||||
|
||||
// Create returns a create builder for DbPackage.
|
||||
// Create returns a builder for creating a DbPackage entity.
|
||||
func (c *DbPackageClient) Create() *DbPackageCreate {
|
||||
mutation := newDbPackageMutation(c.config, OpCreate)
|
||||
return &DbPackageCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
@@ -173,12 +173,12 @@ func (c *DbPackageClient) Delete() *DbPackageDelete {
|
||||
return &DbPackageDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
}
|
||||
|
||||
// DeleteOne returns a delete builder for the given entity.
|
||||
// DeleteOne returns a builder for deleting the given entity.
|
||||
func (c *DbPackageClient) DeleteOne(dp *DbPackage) *DbPackageDeleteOne {
|
||||
return c.DeleteOneID(dp.ID)
|
||||
}
|
||||
|
||||
// DeleteOneID returns a delete builder for the given id.
|
||||
// DeleteOne returns a builder for deleting the given entity by its id.
|
||||
func (c *DbPackageClient) DeleteOneID(id int) *DbPackageDeleteOne {
|
||||
builder := c.Delete().Where(dbpackage.ID(id))
|
||||
builder.mutation.id = &id
|
||||
|
Reference in New Issue
Block a user