github.com/NpoolPlatform/chain-middleware@v0.0.0-20240228100535-eb1bcf896eb9/pkg/db/ent/client.go (about)

     1  // Code generated by ent, DO NOT EDIT.
     2  
     3  package ent
     4  
     5  import (
     6  	"context"
     7  	"errors"
     8  	"fmt"
     9  	"log"
    10  
    11  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/migrate"
    12  
    13  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/appcoin"
    14  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/chainbase"
    15  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/coinbase"
    16  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/coindescription"
    17  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/coinextra"
    18  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/coinfiat"
    19  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/coinfiatcurrency"
    20  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/coinfiatcurrencyhistory"
    21  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/coinusedfor"
    22  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/currency"
    23  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/currencyfeed"
    24  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/currencyhistory"
    25  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/exchangerate"
    26  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/fiat"
    27  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/fiatcurrency"
    28  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/fiatcurrencyfeed"
    29  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/fiatcurrencyhistory"
    30  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/setting"
    31  	"github.com/NpoolPlatform/chain-middleware/pkg/db/ent/tran"
    32  
    33  	"entgo.io/ent/dialect"
    34  	"entgo.io/ent/dialect/sql"
    35  )
    36  
    37  // Client is the client that holds all ent builders.
    38  type Client struct {
    39  	config
    40  	// Schema is the client for creating, migrating and dropping schema.
    41  	Schema *migrate.Schema
    42  	// AppCoin is the client for interacting with the AppCoin builders.
    43  	AppCoin *AppCoinClient
    44  	// ChainBase is the client for interacting with the ChainBase builders.
    45  	ChainBase *ChainBaseClient
    46  	// CoinBase is the client for interacting with the CoinBase builders.
    47  	CoinBase *CoinBaseClient
    48  	// CoinDescription is the client for interacting with the CoinDescription builders.
    49  	CoinDescription *CoinDescriptionClient
    50  	// CoinExtra is the client for interacting with the CoinExtra builders.
    51  	CoinExtra *CoinExtraClient
    52  	// CoinFiat is the client for interacting with the CoinFiat builders.
    53  	CoinFiat *CoinFiatClient
    54  	// CoinFiatCurrency is the client for interacting with the CoinFiatCurrency builders.
    55  	CoinFiatCurrency *CoinFiatCurrencyClient
    56  	// CoinFiatCurrencyHistory is the client for interacting with the CoinFiatCurrencyHistory builders.
    57  	CoinFiatCurrencyHistory *CoinFiatCurrencyHistoryClient
    58  	// CoinUsedFor is the client for interacting with the CoinUsedFor builders.
    59  	CoinUsedFor *CoinUsedForClient
    60  	// Currency is the client for interacting with the Currency builders.
    61  	Currency *CurrencyClient
    62  	// CurrencyFeed is the client for interacting with the CurrencyFeed builders.
    63  	CurrencyFeed *CurrencyFeedClient
    64  	// CurrencyHistory is the client for interacting with the CurrencyHistory builders.
    65  	CurrencyHistory *CurrencyHistoryClient
    66  	// ExchangeRate is the client for interacting with the ExchangeRate builders.
    67  	ExchangeRate *ExchangeRateClient
    68  	// Fiat is the client for interacting with the Fiat builders.
    69  	Fiat *FiatClient
    70  	// FiatCurrency is the client for interacting with the FiatCurrency builders.
    71  	FiatCurrency *FiatCurrencyClient
    72  	// FiatCurrencyFeed is the client for interacting with the FiatCurrencyFeed builders.
    73  	FiatCurrencyFeed *FiatCurrencyFeedClient
    74  	// FiatCurrencyHistory is the client for interacting with the FiatCurrencyHistory builders.
    75  	FiatCurrencyHistory *FiatCurrencyHistoryClient
    76  	// Setting is the client for interacting with the Setting builders.
    77  	Setting *SettingClient
    78  	// Tran is the client for interacting with the Tran builders.
    79  	Tran *TranClient
    80  }
    81  
    82  // NewClient creates a new client configured with the given options.
    83  func NewClient(opts ...Option) *Client {
    84  	cfg := config{log: log.Println, hooks: &hooks{}}
    85  	cfg.options(opts...)
    86  	client := &Client{config: cfg}
    87  	client.init()
    88  	return client
    89  }
    90  
    91  func (c *Client) init() {
    92  	c.Schema = migrate.NewSchema(c.driver)
    93  	c.AppCoin = NewAppCoinClient(c.config)
    94  	c.ChainBase = NewChainBaseClient(c.config)
    95  	c.CoinBase = NewCoinBaseClient(c.config)
    96  	c.CoinDescription = NewCoinDescriptionClient(c.config)
    97  	c.CoinExtra = NewCoinExtraClient(c.config)
    98  	c.CoinFiat = NewCoinFiatClient(c.config)
    99  	c.CoinFiatCurrency = NewCoinFiatCurrencyClient(c.config)
   100  	c.CoinFiatCurrencyHistory = NewCoinFiatCurrencyHistoryClient(c.config)
   101  	c.CoinUsedFor = NewCoinUsedForClient(c.config)
   102  	c.Currency = NewCurrencyClient(c.config)
   103  	c.CurrencyFeed = NewCurrencyFeedClient(c.config)
   104  	c.CurrencyHistory = NewCurrencyHistoryClient(c.config)
   105  	c.ExchangeRate = NewExchangeRateClient(c.config)
   106  	c.Fiat = NewFiatClient(c.config)
   107  	c.FiatCurrency = NewFiatCurrencyClient(c.config)
   108  	c.FiatCurrencyFeed = NewFiatCurrencyFeedClient(c.config)
   109  	c.FiatCurrencyHistory = NewFiatCurrencyHistoryClient(c.config)
   110  	c.Setting = NewSettingClient(c.config)
   111  	c.Tran = NewTranClient(c.config)
   112  }
   113  
   114  // Open opens a database/sql.DB specified by the driver name and
   115  // the data source name, and returns a new client attached to it.
   116  // Optional parameters can be added for configuring the client.
   117  func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
   118  	switch driverName {
   119  	case dialect.MySQL, dialect.Postgres, dialect.SQLite:
   120  		drv, err := sql.Open(driverName, dataSourceName)
   121  		if err != nil {
   122  			return nil, err
   123  		}
   124  		return NewClient(append(options, Driver(drv))...), nil
   125  	default:
   126  		return nil, fmt.Errorf("unsupported driver: %q", driverName)
   127  	}
   128  }
   129  
   130  // Tx returns a new transactional client. The provided context
   131  // is used until the transaction is committed or rolled back.
   132  func (c *Client) Tx(ctx context.Context) (*Tx, error) {
   133  	if _, ok := c.driver.(*txDriver); ok {
   134  		return nil, errors.New("ent: cannot start a transaction within a transaction")
   135  	}
   136  	tx, err := newTx(ctx, c.driver)
   137  	if err != nil {
   138  		return nil, fmt.Errorf("ent: starting a transaction: %w", err)
   139  	}
   140  	cfg := c.config
   141  	cfg.driver = tx
   142  	return &Tx{
   143  		ctx:                     ctx,
   144  		config:                  cfg,
   145  		AppCoin:                 NewAppCoinClient(cfg),
   146  		ChainBase:               NewChainBaseClient(cfg),
   147  		CoinBase:                NewCoinBaseClient(cfg),
   148  		CoinDescription:         NewCoinDescriptionClient(cfg),
   149  		CoinExtra:               NewCoinExtraClient(cfg),
   150  		CoinFiat:                NewCoinFiatClient(cfg),
   151  		CoinFiatCurrency:        NewCoinFiatCurrencyClient(cfg),
   152  		CoinFiatCurrencyHistory: NewCoinFiatCurrencyHistoryClient(cfg),
   153  		CoinUsedFor:             NewCoinUsedForClient(cfg),
   154  		Currency:                NewCurrencyClient(cfg),
   155  		CurrencyFeed:            NewCurrencyFeedClient(cfg),
   156  		CurrencyHistory:         NewCurrencyHistoryClient(cfg),
   157  		ExchangeRate:            NewExchangeRateClient(cfg),
   158  		Fiat:                    NewFiatClient(cfg),
   159  		FiatCurrency:            NewFiatCurrencyClient(cfg),
   160  		FiatCurrencyFeed:        NewFiatCurrencyFeedClient(cfg),
   161  		FiatCurrencyHistory:     NewFiatCurrencyHistoryClient(cfg),
   162  		Setting:                 NewSettingClient(cfg),
   163  		Tran:                    NewTranClient(cfg),
   164  	}, nil
   165  }
   166  
   167  // BeginTx returns a transactional client with specified options.
   168  func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {
   169  	if _, ok := c.driver.(*txDriver); ok {
   170  		return nil, errors.New("ent: cannot start a transaction within a transaction")
   171  	}
   172  	tx, err := c.driver.(interface {
   173  		BeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)
   174  	}).BeginTx(ctx, opts)
   175  	if err != nil {
   176  		return nil, fmt.Errorf("ent: starting a transaction: %w", err)
   177  	}
   178  	cfg := c.config
   179  	cfg.driver = &txDriver{tx: tx, drv: c.driver}
   180  	return &Tx{
   181  		ctx:                     ctx,
   182  		config:                  cfg,
   183  		AppCoin:                 NewAppCoinClient(cfg),
   184  		ChainBase:               NewChainBaseClient(cfg),
   185  		CoinBase:                NewCoinBaseClient(cfg),
   186  		CoinDescription:         NewCoinDescriptionClient(cfg),
   187  		CoinExtra:               NewCoinExtraClient(cfg),
   188  		CoinFiat:                NewCoinFiatClient(cfg),
   189  		CoinFiatCurrency:        NewCoinFiatCurrencyClient(cfg),
   190  		CoinFiatCurrencyHistory: NewCoinFiatCurrencyHistoryClient(cfg),
   191  		CoinUsedFor:             NewCoinUsedForClient(cfg),
   192  		Currency:                NewCurrencyClient(cfg),
   193  		CurrencyFeed:            NewCurrencyFeedClient(cfg),
   194  		CurrencyHistory:         NewCurrencyHistoryClient(cfg),
   195  		ExchangeRate:            NewExchangeRateClient(cfg),
   196  		Fiat:                    NewFiatClient(cfg),
   197  		FiatCurrency:            NewFiatCurrencyClient(cfg),
   198  		FiatCurrencyFeed:        NewFiatCurrencyFeedClient(cfg),
   199  		FiatCurrencyHistory:     NewFiatCurrencyHistoryClient(cfg),
   200  		Setting:                 NewSettingClient(cfg),
   201  		Tran:                    NewTranClient(cfg),
   202  	}, nil
   203  }
   204  
   205  // Debug returns a new debug-client. It's used to get verbose logging on specific operations.
   206  //
   207  //	client.Debug().
   208  //		AppCoin.
   209  //		Query().
   210  //		Count(ctx)
   211  //
   212  func (c *Client) Debug() *Client {
   213  	if c.debug {
   214  		return c
   215  	}
   216  	cfg := c.config
   217  	cfg.driver = dialect.Debug(c.driver, c.log)
   218  	client := &Client{config: cfg}
   219  	client.init()
   220  	return client
   221  }
   222  
   223  // Close closes the database connection and prevents new queries from starting.
   224  func (c *Client) Close() error {
   225  	return c.driver.Close()
   226  }
   227  
   228  // Use adds the mutation hooks to all the entity clients.
   229  // In order to add hooks to a specific client, call: `client.Node.Use(...)`.
   230  func (c *Client) Use(hooks ...Hook) {
   231  	c.AppCoin.Use(hooks...)
   232  	c.ChainBase.Use(hooks...)
   233  	c.CoinBase.Use(hooks...)
   234  	c.CoinDescription.Use(hooks...)
   235  	c.CoinExtra.Use(hooks...)
   236  	c.CoinFiat.Use(hooks...)
   237  	c.CoinFiatCurrency.Use(hooks...)
   238  	c.CoinFiatCurrencyHistory.Use(hooks...)
   239  	c.CoinUsedFor.Use(hooks...)
   240  	c.Currency.Use(hooks...)
   241  	c.CurrencyFeed.Use(hooks...)
   242  	c.CurrencyHistory.Use(hooks...)
   243  	c.ExchangeRate.Use(hooks...)
   244  	c.Fiat.Use(hooks...)
   245  	c.FiatCurrency.Use(hooks...)
   246  	c.FiatCurrencyFeed.Use(hooks...)
   247  	c.FiatCurrencyHistory.Use(hooks...)
   248  	c.Setting.Use(hooks...)
   249  	c.Tran.Use(hooks...)
   250  }
   251  
   252  // AppCoinClient is a client for the AppCoin schema.
   253  type AppCoinClient struct {
   254  	config
   255  }
   256  
   257  // NewAppCoinClient returns a client for the AppCoin from the given config.
   258  func NewAppCoinClient(c config) *AppCoinClient {
   259  	return &AppCoinClient{config: c}
   260  }
   261  
   262  // Use adds a list of mutation hooks to the hooks stack.
   263  // A call to `Use(f, g, h)` equals to `appcoin.Hooks(f(g(h())))`.
   264  func (c *AppCoinClient) Use(hooks ...Hook) {
   265  	c.hooks.AppCoin = append(c.hooks.AppCoin, hooks...)
   266  }
   267  
   268  // Create returns a builder for creating a AppCoin entity.
   269  func (c *AppCoinClient) Create() *AppCoinCreate {
   270  	mutation := newAppCoinMutation(c.config, OpCreate)
   271  	return &AppCoinCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   272  }
   273  
   274  // CreateBulk returns a builder for creating a bulk of AppCoin entities.
   275  func (c *AppCoinClient) CreateBulk(builders ...*AppCoinCreate) *AppCoinCreateBulk {
   276  	return &AppCoinCreateBulk{config: c.config, builders: builders}
   277  }
   278  
   279  // Update returns an update builder for AppCoin.
   280  func (c *AppCoinClient) Update() *AppCoinUpdate {
   281  	mutation := newAppCoinMutation(c.config, OpUpdate)
   282  	return &AppCoinUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   283  }
   284  
   285  // UpdateOne returns an update builder for the given entity.
   286  func (c *AppCoinClient) UpdateOne(ac *AppCoin) *AppCoinUpdateOne {
   287  	mutation := newAppCoinMutation(c.config, OpUpdateOne, withAppCoin(ac))
   288  	return &AppCoinUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   289  }
   290  
   291  // UpdateOneID returns an update builder for the given id.
   292  func (c *AppCoinClient) UpdateOneID(id uint32) *AppCoinUpdateOne {
   293  	mutation := newAppCoinMutation(c.config, OpUpdateOne, withAppCoinID(id))
   294  	return &AppCoinUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   295  }
   296  
   297  // Delete returns a delete builder for AppCoin.
   298  func (c *AppCoinClient) Delete() *AppCoinDelete {
   299  	mutation := newAppCoinMutation(c.config, OpDelete)
   300  	return &AppCoinDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
   301  }
   302  
   303  // DeleteOne returns a builder for deleting the given entity.
   304  func (c *AppCoinClient) DeleteOne(ac *AppCoin) *AppCoinDeleteOne {
   305  	return c.DeleteOneID(ac.ID)
   306  }
   307  
   308  // DeleteOne returns a builder for deleting the given entity by its id.
   309  func (c *AppCoinClient) DeleteOneID(id uint32) *AppCoinDeleteOne {
   310  	builder := c.Delete().Where(appcoin.ID(id))
   311  	builder.mutation.id = &id
   312  	builder.mutation.op = OpDeleteOne
   313  	return &AppCoinDeleteOne{builder}
   314  }
   315  
   316  // Query returns a query builder for AppCoin.
   317  func (c *AppCoinClient) Query() *AppCoinQuery {
   318  	return &AppCoinQuery{
   319  		config: c.config,
   320  	}
   321  }
   322  
   323  // Get returns a AppCoin entity by its id.
   324  func (c *AppCoinClient) Get(ctx context.Context, id uint32) (*AppCoin, error) {
   325  	return c.Query().Where(appcoin.ID(id)).Only(ctx)
   326  }
   327  
   328  // GetX is like Get, but panics if an error occurs.
   329  func (c *AppCoinClient) GetX(ctx context.Context, id uint32) *AppCoin {
   330  	obj, err := c.Get(ctx, id)
   331  	if err != nil {
   332  		panic(err)
   333  	}
   334  	return obj
   335  }
   336  
   337  // Hooks returns the client hooks.
   338  func (c *AppCoinClient) Hooks() []Hook {
   339  	hooks := c.hooks.AppCoin
   340  	return append(hooks[:len(hooks):len(hooks)], appcoin.Hooks[:]...)
   341  }
   342  
   343  // ChainBaseClient is a client for the ChainBase schema.
   344  type ChainBaseClient struct {
   345  	config
   346  }
   347  
   348  // NewChainBaseClient returns a client for the ChainBase from the given config.
   349  func NewChainBaseClient(c config) *ChainBaseClient {
   350  	return &ChainBaseClient{config: c}
   351  }
   352  
   353  // Use adds a list of mutation hooks to the hooks stack.
   354  // A call to `Use(f, g, h)` equals to `chainbase.Hooks(f(g(h())))`.
   355  func (c *ChainBaseClient) Use(hooks ...Hook) {
   356  	c.hooks.ChainBase = append(c.hooks.ChainBase, hooks...)
   357  }
   358  
   359  // Create returns a builder for creating a ChainBase entity.
   360  func (c *ChainBaseClient) Create() *ChainBaseCreate {
   361  	mutation := newChainBaseMutation(c.config, OpCreate)
   362  	return &ChainBaseCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   363  }
   364  
   365  // CreateBulk returns a builder for creating a bulk of ChainBase entities.
   366  func (c *ChainBaseClient) CreateBulk(builders ...*ChainBaseCreate) *ChainBaseCreateBulk {
   367  	return &ChainBaseCreateBulk{config: c.config, builders: builders}
   368  }
   369  
   370  // Update returns an update builder for ChainBase.
   371  func (c *ChainBaseClient) Update() *ChainBaseUpdate {
   372  	mutation := newChainBaseMutation(c.config, OpUpdate)
   373  	return &ChainBaseUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   374  }
   375  
   376  // UpdateOne returns an update builder for the given entity.
   377  func (c *ChainBaseClient) UpdateOne(cb *ChainBase) *ChainBaseUpdateOne {
   378  	mutation := newChainBaseMutation(c.config, OpUpdateOne, withChainBase(cb))
   379  	return &ChainBaseUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   380  }
   381  
   382  // UpdateOneID returns an update builder for the given id.
   383  func (c *ChainBaseClient) UpdateOneID(id uint32) *ChainBaseUpdateOne {
   384  	mutation := newChainBaseMutation(c.config, OpUpdateOne, withChainBaseID(id))
   385  	return &ChainBaseUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   386  }
   387  
   388  // Delete returns a delete builder for ChainBase.
   389  func (c *ChainBaseClient) Delete() *ChainBaseDelete {
   390  	mutation := newChainBaseMutation(c.config, OpDelete)
   391  	return &ChainBaseDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
   392  }
   393  
   394  // DeleteOne returns a builder for deleting the given entity.
   395  func (c *ChainBaseClient) DeleteOne(cb *ChainBase) *ChainBaseDeleteOne {
   396  	return c.DeleteOneID(cb.ID)
   397  }
   398  
   399  // DeleteOne returns a builder for deleting the given entity by its id.
   400  func (c *ChainBaseClient) DeleteOneID(id uint32) *ChainBaseDeleteOne {
   401  	builder := c.Delete().Where(chainbase.ID(id))
   402  	builder.mutation.id = &id
   403  	builder.mutation.op = OpDeleteOne
   404  	return &ChainBaseDeleteOne{builder}
   405  }
   406  
   407  // Query returns a query builder for ChainBase.
   408  func (c *ChainBaseClient) Query() *ChainBaseQuery {
   409  	return &ChainBaseQuery{
   410  		config: c.config,
   411  	}
   412  }
   413  
   414  // Get returns a ChainBase entity by its id.
   415  func (c *ChainBaseClient) Get(ctx context.Context, id uint32) (*ChainBase, error) {
   416  	return c.Query().Where(chainbase.ID(id)).Only(ctx)
   417  }
   418  
   419  // GetX is like Get, but panics if an error occurs.
   420  func (c *ChainBaseClient) GetX(ctx context.Context, id uint32) *ChainBase {
   421  	obj, err := c.Get(ctx, id)
   422  	if err != nil {
   423  		panic(err)
   424  	}
   425  	return obj
   426  }
   427  
   428  // Hooks returns the client hooks.
   429  func (c *ChainBaseClient) Hooks() []Hook {
   430  	hooks := c.hooks.ChainBase
   431  	return append(hooks[:len(hooks):len(hooks)], chainbase.Hooks[:]...)
   432  }
   433  
   434  // CoinBaseClient is a client for the CoinBase schema.
   435  type CoinBaseClient struct {
   436  	config
   437  }
   438  
   439  // NewCoinBaseClient returns a client for the CoinBase from the given config.
   440  func NewCoinBaseClient(c config) *CoinBaseClient {
   441  	return &CoinBaseClient{config: c}
   442  }
   443  
   444  // Use adds a list of mutation hooks to the hooks stack.
   445  // A call to `Use(f, g, h)` equals to `coinbase.Hooks(f(g(h())))`.
   446  func (c *CoinBaseClient) Use(hooks ...Hook) {
   447  	c.hooks.CoinBase = append(c.hooks.CoinBase, hooks...)
   448  }
   449  
   450  // Create returns a builder for creating a CoinBase entity.
   451  func (c *CoinBaseClient) Create() *CoinBaseCreate {
   452  	mutation := newCoinBaseMutation(c.config, OpCreate)
   453  	return &CoinBaseCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   454  }
   455  
   456  // CreateBulk returns a builder for creating a bulk of CoinBase entities.
   457  func (c *CoinBaseClient) CreateBulk(builders ...*CoinBaseCreate) *CoinBaseCreateBulk {
   458  	return &CoinBaseCreateBulk{config: c.config, builders: builders}
   459  }
   460  
   461  // Update returns an update builder for CoinBase.
   462  func (c *CoinBaseClient) Update() *CoinBaseUpdate {
   463  	mutation := newCoinBaseMutation(c.config, OpUpdate)
   464  	return &CoinBaseUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   465  }
   466  
   467  // UpdateOne returns an update builder for the given entity.
   468  func (c *CoinBaseClient) UpdateOne(cb *CoinBase) *CoinBaseUpdateOne {
   469  	mutation := newCoinBaseMutation(c.config, OpUpdateOne, withCoinBase(cb))
   470  	return &CoinBaseUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   471  }
   472  
   473  // UpdateOneID returns an update builder for the given id.
   474  func (c *CoinBaseClient) UpdateOneID(id uint32) *CoinBaseUpdateOne {
   475  	mutation := newCoinBaseMutation(c.config, OpUpdateOne, withCoinBaseID(id))
   476  	return &CoinBaseUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   477  }
   478  
   479  // Delete returns a delete builder for CoinBase.
   480  func (c *CoinBaseClient) Delete() *CoinBaseDelete {
   481  	mutation := newCoinBaseMutation(c.config, OpDelete)
   482  	return &CoinBaseDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
   483  }
   484  
   485  // DeleteOne returns a builder for deleting the given entity.
   486  func (c *CoinBaseClient) DeleteOne(cb *CoinBase) *CoinBaseDeleteOne {
   487  	return c.DeleteOneID(cb.ID)
   488  }
   489  
   490  // DeleteOne returns a builder for deleting the given entity by its id.
   491  func (c *CoinBaseClient) DeleteOneID(id uint32) *CoinBaseDeleteOne {
   492  	builder := c.Delete().Where(coinbase.ID(id))
   493  	builder.mutation.id = &id
   494  	builder.mutation.op = OpDeleteOne
   495  	return &CoinBaseDeleteOne{builder}
   496  }
   497  
   498  // Query returns a query builder for CoinBase.
   499  func (c *CoinBaseClient) Query() *CoinBaseQuery {
   500  	return &CoinBaseQuery{
   501  		config: c.config,
   502  	}
   503  }
   504  
   505  // Get returns a CoinBase entity by its id.
   506  func (c *CoinBaseClient) Get(ctx context.Context, id uint32) (*CoinBase, error) {
   507  	return c.Query().Where(coinbase.ID(id)).Only(ctx)
   508  }
   509  
   510  // GetX is like Get, but panics if an error occurs.
   511  func (c *CoinBaseClient) GetX(ctx context.Context, id uint32) *CoinBase {
   512  	obj, err := c.Get(ctx, id)
   513  	if err != nil {
   514  		panic(err)
   515  	}
   516  	return obj
   517  }
   518  
   519  // Hooks returns the client hooks.
   520  func (c *CoinBaseClient) Hooks() []Hook {
   521  	hooks := c.hooks.CoinBase
   522  	return append(hooks[:len(hooks):len(hooks)], coinbase.Hooks[:]...)
   523  }
   524  
   525  // CoinDescriptionClient is a client for the CoinDescription schema.
   526  type CoinDescriptionClient struct {
   527  	config
   528  }
   529  
   530  // NewCoinDescriptionClient returns a client for the CoinDescription from the given config.
   531  func NewCoinDescriptionClient(c config) *CoinDescriptionClient {
   532  	return &CoinDescriptionClient{config: c}
   533  }
   534  
   535  // Use adds a list of mutation hooks to the hooks stack.
   536  // A call to `Use(f, g, h)` equals to `coindescription.Hooks(f(g(h())))`.
   537  func (c *CoinDescriptionClient) Use(hooks ...Hook) {
   538  	c.hooks.CoinDescription = append(c.hooks.CoinDescription, hooks...)
   539  }
   540  
   541  // Create returns a builder for creating a CoinDescription entity.
   542  func (c *CoinDescriptionClient) Create() *CoinDescriptionCreate {
   543  	mutation := newCoinDescriptionMutation(c.config, OpCreate)
   544  	return &CoinDescriptionCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   545  }
   546  
   547  // CreateBulk returns a builder for creating a bulk of CoinDescription entities.
   548  func (c *CoinDescriptionClient) CreateBulk(builders ...*CoinDescriptionCreate) *CoinDescriptionCreateBulk {
   549  	return &CoinDescriptionCreateBulk{config: c.config, builders: builders}
   550  }
   551  
   552  // Update returns an update builder for CoinDescription.
   553  func (c *CoinDescriptionClient) Update() *CoinDescriptionUpdate {
   554  	mutation := newCoinDescriptionMutation(c.config, OpUpdate)
   555  	return &CoinDescriptionUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   556  }
   557  
   558  // UpdateOne returns an update builder for the given entity.
   559  func (c *CoinDescriptionClient) UpdateOne(cd *CoinDescription) *CoinDescriptionUpdateOne {
   560  	mutation := newCoinDescriptionMutation(c.config, OpUpdateOne, withCoinDescription(cd))
   561  	return &CoinDescriptionUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   562  }
   563  
   564  // UpdateOneID returns an update builder for the given id.
   565  func (c *CoinDescriptionClient) UpdateOneID(id uint32) *CoinDescriptionUpdateOne {
   566  	mutation := newCoinDescriptionMutation(c.config, OpUpdateOne, withCoinDescriptionID(id))
   567  	return &CoinDescriptionUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   568  }
   569  
   570  // Delete returns a delete builder for CoinDescription.
   571  func (c *CoinDescriptionClient) Delete() *CoinDescriptionDelete {
   572  	mutation := newCoinDescriptionMutation(c.config, OpDelete)
   573  	return &CoinDescriptionDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
   574  }
   575  
   576  // DeleteOne returns a builder for deleting the given entity.
   577  func (c *CoinDescriptionClient) DeleteOne(cd *CoinDescription) *CoinDescriptionDeleteOne {
   578  	return c.DeleteOneID(cd.ID)
   579  }
   580  
   581  // DeleteOne returns a builder for deleting the given entity by its id.
   582  func (c *CoinDescriptionClient) DeleteOneID(id uint32) *CoinDescriptionDeleteOne {
   583  	builder := c.Delete().Where(coindescription.ID(id))
   584  	builder.mutation.id = &id
   585  	builder.mutation.op = OpDeleteOne
   586  	return &CoinDescriptionDeleteOne{builder}
   587  }
   588  
   589  // Query returns a query builder for CoinDescription.
   590  func (c *CoinDescriptionClient) Query() *CoinDescriptionQuery {
   591  	return &CoinDescriptionQuery{
   592  		config: c.config,
   593  	}
   594  }
   595  
   596  // Get returns a CoinDescription entity by its id.
   597  func (c *CoinDescriptionClient) Get(ctx context.Context, id uint32) (*CoinDescription, error) {
   598  	return c.Query().Where(coindescription.ID(id)).Only(ctx)
   599  }
   600  
   601  // GetX is like Get, but panics if an error occurs.
   602  func (c *CoinDescriptionClient) GetX(ctx context.Context, id uint32) *CoinDescription {
   603  	obj, err := c.Get(ctx, id)
   604  	if err != nil {
   605  		panic(err)
   606  	}
   607  	return obj
   608  }
   609  
   610  // Hooks returns the client hooks.
   611  func (c *CoinDescriptionClient) Hooks() []Hook {
   612  	hooks := c.hooks.CoinDescription
   613  	return append(hooks[:len(hooks):len(hooks)], coindescription.Hooks[:]...)
   614  }
   615  
   616  // CoinExtraClient is a client for the CoinExtra schema.
   617  type CoinExtraClient struct {
   618  	config
   619  }
   620  
   621  // NewCoinExtraClient returns a client for the CoinExtra from the given config.
   622  func NewCoinExtraClient(c config) *CoinExtraClient {
   623  	return &CoinExtraClient{config: c}
   624  }
   625  
   626  // Use adds a list of mutation hooks to the hooks stack.
   627  // A call to `Use(f, g, h)` equals to `coinextra.Hooks(f(g(h())))`.
   628  func (c *CoinExtraClient) Use(hooks ...Hook) {
   629  	c.hooks.CoinExtra = append(c.hooks.CoinExtra, hooks...)
   630  }
   631  
   632  // Create returns a builder for creating a CoinExtra entity.
   633  func (c *CoinExtraClient) Create() *CoinExtraCreate {
   634  	mutation := newCoinExtraMutation(c.config, OpCreate)
   635  	return &CoinExtraCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   636  }
   637  
   638  // CreateBulk returns a builder for creating a bulk of CoinExtra entities.
   639  func (c *CoinExtraClient) CreateBulk(builders ...*CoinExtraCreate) *CoinExtraCreateBulk {
   640  	return &CoinExtraCreateBulk{config: c.config, builders: builders}
   641  }
   642  
   643  // Update returns an update builder for CoinExtra.
   644  func (c *CoinExtraClient) Update() *CoinExtraUpdate {
   645  	mutation := newCoinExtraMutation(c.config, OpUpdate)
   646  	return &CoinExtraUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   647  }
   648  
   649  // UpdateOne returns an update builder for the given entity.
   650  func (c *CoinExtraClient) UpdateOne(ce *CoinExtra) *CoinExtraUpdateOne {
   651  	mutation := newCoinExtraMutation(c.config, OpUpdateOne, withCoinExtra(ce))
   652  	return &CoinExtraUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   653  }
   654  
   655  // UpdateOneID returns an update builder for the given id.
   656  func (c *CoinExtraClient) UpdateOneID(id uint32) *CoinExtraUpdateOne {
   657  	mutation := newCoinExtraMutation(c.config, OpUpdateOne, withCoinExtraID(id))
   658  	return &CoinExtraUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   659  }
   660  
   661  // Delete returns a delete builder for CoinExtra.
   662  func (c *CoinExtraClient) Delete() *CoinExtraDelete {
   663  	mutation := newCoinExtraMutation(c.config, OpDelete)
   664  	return &CoinExtraDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
   665  }
   666  
   667  // DeleteOne returns a builder for deleting the given entity.
   668  func (c *CoinExtraClient) DeleteOne(ce *CoinExtra) *CoinExtraDeleteOne {
   669  	return c.DeleteOneID(ce.ID)
   670  }
   671  
   672  // DeleteOne returns a builder for deleting the given entity by its id.
   673  func (c *CoinExtraClient) DeleteOneID(id uint32) *CoinExtraDeleteOne {
   674  	builder := c.Delete().Where(coinextra.ID(id))
   675  	builder.mutation.id = &id
   676  	builder.mutation.op = OpDeleteOne
   677  	return &CoinExtraDeleteOne{builder}
   678  }
   679  
   680  // Query returns a query builder for CoinExtra.
   681  func (c *CoinExtraClient) Query() *CoinExtraQuery {
   682  	return &CoinExtraQuery{
   683  		config: c.config,
   684  	}
   685  }
   686  
   687  // Get returns a CoinExtra entity by its id.
   688  func (c *CoinExtraClient) Get(ctx context.Context, id uint32) (*CoinExtra, error) {
   689  	return c.Query().Where(coinextra.ID(id)).Only(ctx)
   690  }
   691  
   692  // GetX is like Get, but panics if an error occurs.
   693  func (c *CoinExtraClient) GetX(ctx context.Context, id uint32) *CoinExtra {
   694  	obj, err := c.Get(ctx, id)
   695  	if err != nil {
   696  		panic(err)
   697  	}
   698  	return obj
   699  }
   700  
   701  // Hooks returns the client hooks.
   702  func (c *CoinExtraClient) Hooks() []Hook {
   703  	hooks := c.hooks.CoinExtra
   704  	return append(hooks[:len(hooks):len(hooks)], coinextra.Hooks[:]...)
   705  }
   706  
   707  // CoinFiatClient is a client for the CoinFiat schema.
   708  type CoinFiatClient struct {
   709  	config
   710  }
   711  
   712  // NewCoinFiatClient returns a client for the CoinFiat from the given config.
   713  func NewCoinFiatClient(c config) *CoinFiatClient {
   714  	return &CoinFiatClient{config: c}
   715  }
   716  
   717  // Use adds a list of mutation hooks to the hooks stack.
   718  // A call to `Use(f, g, h)` equals to `coinfiat.Hooks(f(g(h())))`.
   719  func (c *CoinFiatClient) Use(hooks ...Hook) {
   720  	c.hooks.CoinFiat = append(c.hooks.CoinFiat, hooks...)
   721  }
   722  
   723  // Create returns a builder for creating a CoinFiat entity.
   724  func (c *CoinFiatClient) Create() *CoinFiatCreate {
   725  	mutation := newCoinFiatMutation(c.config, OpCreate)
   726  	return &CoinFiatCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   727  }
   728  
   729  // CreateBulk returns a builder for creating a bulk of CoinFiat entities.
   730  func (c *CoinFiatClient) CreateBulk(builders ...*CoinFiatCreate) *CoinFiatCreateBulk {
   731  	return &CoinFiatCreateBulk{config: c.config, builders: builders}
   732  }
   733  
   734  // Update returns an update builder for CoinFiat.
   735  func (c *CoinFiatClient) Update() *CoinFiatUpdate {
   736  	mutation := newCoinFiatMutation(c.config, OpUpdate)
   737  	return &CoinFiatUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   738  }
   739  
   740  // UpdateOne returns an update builder for the given entity.
   741  func (c *CoinFiatClient) UpdateOne(cf *CoinFiat) *CoinFiatUpdateOne {
   742  	mutation := newCoinFiatMutation(c.config, OpUpdateOne, withCoinFiat(cf))
   743  	return &CoinFiatUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   744  }
   745  
   746  // UpdateOneID returns an update builder for the given id.
   747  func (c *CoinFiatClient) UpdateOneID(id uint32) *CoinFiatUpdateOne {
   748  	mutation := newCoinFiatMutation(c.config, OpUpdateOne, withCoinFiatID(id))
   749  	return &CoinFiatUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   750  }
   751  
   752  // Delete returns a delete builder for CoinFiat.
   753  func (c *CoinFiatClient) Delete() *CoinFiatDelete {
   754  	mutation := newCoinFiatMutation(c.config, OpDelete)
   755  	return &CoinFiatDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
   756  }
   757  
   758  // DeleteOne returns a builder for deleting the given entity.
   759  func (c *CoinFiatClient) DeleteOne(cf *CoinFiat) *CoinFiatDeleteOne {
   760  	return c.DeleteOneID(cf.ID)
   761  }
   762  
   763  // DeleteOne returns a builder for deleting the given entity by its id.
   764  func (c *CoinFiatClient) DeleteOneID(id uint32) *CoinFiatDeleteOne {
   765  	builder := c.Delete().Where(coinfiat.ID(id))
   766  	builder.mutation.id = &id
   767  	builder.mutation.op = OpDeleteOne
   768  	return &CoinFiatDeleteOne{builder}
   769  }
   770  
   771  // Query returns a query builder for CoinFiat.
   772  func (c *CoinFiatClient) Query() *CoinFiatQuery {
   773  	return &CoinFiatQuery{
   774  		config: c.config,
   775  	}
   776  }
   777  
   778  // Get returns a CoinFiat entity by its id.
   779  func (c *CoinFiatClient) Get(ctx context.Context, id uint32) (*CoinFiat, error) {
   780  	return c.Query().Where(coinfiat.ID(id)).Only(ctx)
   781  }
   782  
   783  // GetX is like Get, but panics if an error occurs.
   784  func (c *CoinFiatClient) GetX(ctx context.Context, id uint32) *CoinFiat {
   785  	obj, err := c.Get(ctx, id)
   786  	if err != nil {
   787  		panic(err)
   788  	}
   789  	return obj
   790  }
   791  
   792  // Hooks returns the client hooks.
   793  func (c *CoinFiatClient) Hooks() []Hook {
   794  	hooks := c.hooks.CoinFiat
   795  	return append(hooks[:len(hooks):len(hooks)], coinfiat.Hooks[:]...)
   796  }
   797  
   798  // CoinFiatCurrencyClient is a client for the CoinFiatCurrency schema.
   799  type CoinFiatCurrencyClient struct {
   800  	config
   801  }
   802  
   803  // NewCoinFiatCurrencyClient returns a client for the CoinFiatCurrency from the given config.
   804  func NewCoinFiatCurrencyClient(c config) *CoinFiatCurrencyClient {
   805  	return &CoinFiatCurrencyClient{config: c}
   806  }
   807  
   808  // Use adds a list of mutation hooks to the hooks stack.
   809  // A call to `Use(f, g, h)` equals to `coinfiatcurrency.Hooks(f(g(h())))`.
   810  func (c *CoinFiatCurrencyClient) Use(hooks ...Hook) {
   811  	c.hooks.CoinFiatCurrency = append(c.hooks.CoinFiatCurrency, hooks...)
   812  }
   813  
   814  // Create returns a builder for creating a CoinFiatCurrency entity.
   815  func (c *CoinFiatCurrencyClient) Create() *CoinFiatCurrencyCreate {
   816  	mutation := newCoinFiatCurrencyMutation(c.config, OpCreate)
   817  	return &CoinFiatCurrencyCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   818  }
   819  
   820  // CreateBulk returns a builder for creating a bulk of CoinFiatCurrency entities.
   821  func (c *CoinFiatCurrencyClient) CreateBulk(builders ...*CoinFiatCurrencyCreate) *CoinFiatCurrencyCreateBulk {
   822  	return &CoinFiatCurrencyCreateBulk{config: c.config, builders: builders}
   823  }
   824  
   825  // Update returns an update builder for CoinFiatCurrency.
   826  func (c *CoinFiatCurrencyClient) Update() *CoinFiatCurrencyUpdate {
   827  	mutation := newCoinFiatCurrencyMutation(c.config, OpUpdate)
   828  	return &CoinFiatCurrencyUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   829  }
   830  
   831  // UpdateOne returns an update builder for the given entity.
   832  func (c *CoinFiatCurrencyClient) UpdateOne(cfc *CoinFiatCurrency) *CoinFiatCurrencyUpdateOne {
   833  	mutation := newCoinFiatCurrencyMutation(c.config, OpUpdateOne, withCoinFiatCurrency(cfc))
   834  	return &CoinFiatCurrencyUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   835  }
   836  
   837  // UpdateOneID returns an update builder for the given id.
   838  func (c *CoinFiatCurrencyClient) UpdateOneID(id uint32) *CoinFiatCurrencyUpdateOne {
   839  	mutation := newCoinFiatCurrencyMutation(c.config, OpUpdateOne, withCoinFiatCurrencyID(id))
   840  	return &CoinFiatCurrencyUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   841  }
   842  
   843  // Delete returns a delete builder for CoinFiatCurrency.
   844  func (c *CoinFiatCurrencyClient) Delete() *CoinFiatCurrencyDelete {
   845  	mutation := newCoinFiatCurrencyMutation(c.config, OpDelete)
   846  	return &CoinFiatCurrencyDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
   847  }
   848  
   849  // DeleteOne returns a builder for deleting the given entity.
   850  func (c *CoinFiatCurrencyClient) DeleteOne(cfc *CoinFiatCurrency) *CoinFiatCurrencyDeleteOne {
   851  	return c.DeleteOneID(cfc.ID)
   852  }
   853  
   854  // DeleteOne returns a builder for deleting the given entity by its id.
   855  func (c *CoinFiatCurrencyClient) DeleteOneID(id uint32) *CoinFiatCurrencyDeleteOne {
   856  	builder := c.Delete().Where(coinfiatcurrency.ID(id))
   857  	builder.mutation.id = &id
   858  	builder.mutation.op = OpDeleteOne
   859  	return &CoinFiatCurrencyDeleteOne{builder}
   860  }
   861  
   862  // Query returns a query builder for CoinFiatCurrency.
   863  func (c *CoinFiatCurrencyClient) Query() *CoinFiatCurrencyQuery {
   864  	return &CoinFiatCurrencyQuery{
   865  		config: c.config,
   866  	}
   867  }
   868  
   869  // Get returns a CoinFiatCurrency entity by its id.
   870  func (c *CoinFiatCurrencyClient) Get(ctx context.Context, id uint32) (*CoinFiatCurrency, error) {
   871  	return c.Query().Where(coinfiatcurrency.ID(id)).Only(ctx)
   872  }
   873  
   874  // GetX is like Get, but panics if an error occurs.
   875  func (c *CoinFiatCurrencyClient) GetX(ctx context.Context, id uint32) *CoinFiatCurrency {
   876  	obj, err := c.Get(ctx, id)
   877  	if err != nil {
   878  		panic(err)
   879  	}
   880  	return obj
   881  }
   882  
   883  // Hooks returns the client hooks.
   884  func (c *CoinFiatCurrencyClient) Hooks() []Hook {
   885  	hooks := c.hooks.CoinFiatCurrency
   886  	return append(hooks[:len(hooks):len(hooks)], coinfiatcurrency.Hooks[:]...)
   887  }
   888  
   889  // CoinFiatCurrencyHistoryClient is a client for the CoinFiatCurrencyHistory schema.
   890  type CoinFiatCurrencyHistoryClient struct {
   891  	config
   892  }
   893  
   894  // NewCoinFiatCurrencyHistoryClient returns a client for the CoinFiatCurrencyHistory from the given config.
   895  func NewCoinFiatCurrencyHistoryClient(c config) *CoinFiatCurrencyHistoryClient {
   896  	return &CoinFiatCurrencyHistoryClient{config: c}
   897  }
   898  
   899  // Use adds a list of mutation hooks to the hooks stack.
   900  // A call to `Use(f, g, h)` equals to `coinfiatcurrencyhistory.Hooks(f(g(h())))`.
   901  func (c *CoinFiatCurrencyHistoryClient) Use(hooks ...Hook) {
   902  	c.hooks.CoinFiatCurrencyHistory = append(c.hooks.CoinFiatCurrencyHistory, hooks...)
   903  }
   904  
   905  // Create returns a builder for creating a CoinFiatCurrencyHistory entity.
   906  func (c *CoinFiatCurrencyHistoryClient) Create() *CoinFiatCurrencyHistoryCreate {
   907  	mutation := newCoinFiatCurrencyHistoryMutation(c.config, OpCreate)
   908  	return &CoinFiatCurrencyHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   909  }
   910  
   911  // CreateBulk returns a builder for creating a bulk of CoinFiatCurrencyHistory entities.
   912  func (c *CoinFiatCurrencyHistoryClient) CreateBulk(builders ...*CoinFiatCurrencyHistoryCreate) *CoinFiatCurrencyHistoryCreateBulk {
   913  	return &CoinFiatCurrencyHistoryCreateBulk{config: c.config, builders: builders}
   914  }
   915  
   916  // Update returns an update builder for CoinFiatCurrencyHistory.
   917  func (c *CoinFiatCurrencyHistoryClient) Update() *CoinFiatCurrencyHistoryUpdate {
   918  	mutation := newCoinFiatCurrencyHistoryMutation(c.config, OpUpdate)
   919  	return &CoinFiatCurrencyHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
   920  }
   921  
   922  // UpdateOne returns an update builder for the given entity.
   923  func (c *CoinFiatCurrencyHistoryClient) UpdateOne(cfch *CoinFiatCurrencyHistory) *CoinFiatCurrencyHistoryUpdateOne {
   924  	mutation := newCoinFiatCurrencyHistoryMutation(c.config, OpUpdateOne, withCoinFiatCurrencyHistory(cfch))
   925  	return &CoinFiatCurrencyHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   926  }
   927  
   928  // UpdateOneID returns an update builder for the given id.
   929  func (c *CoinFiatCurrencyHistoryClient) UpdateOneID(id uint32) *CoinFiatCurrencyHistoryUpdateOne {
   930  	mutation := newCoinFiatCurrencyHistoryMutation(c.config, OpUpdateOne, withCoinFiatCurrencyHistoryID(id))
   931  	return &CoinFiatCurrencyHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
   932  }
   933  
   934  // Delete returns a delete builder for CoinFiatCurrencyHistory.
   935  func (c *CoinFiatCurrencyHistoryClient) Delete() *CoinFiatCurrencyHistoryDelete {
   936  	mutation := newCoinFiatCurrencyHistoryMutation(c.config, OpDelete)
   937  	return &CoinFiatCurrencyHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
   938  }
   939  
   940  // DeleteOne returns a builder for deleting the given entity.
   941  func (c *CoinFiatCurrencyHistoryClient) DeleteOne(cfch *CoinFiatCurrencyHistory) *CoinFiatCurrencyHistoryDeleteOne {
   942  	return c.DeleteOneID(cfch.ID)
   943  }
   944  
   945  // DeleteOne returns a builder for deleting the given entity by its id.
   946  func (c *CoinFiatCurrencyHistoryClient) DeleteOneID(id uint32) *CoinFiatCurrencyHistoryDeleteOne {
   947  	builder := c.Delete().Where(coinfiatcurrencyhistory.ID(id))
   948  	builder.mutation.id = &id
   949  	builder.mutation.op = OpDeleteOne
   950  	return &CoinFiatCurrencyHistoryDeleteOne{builder}
   951  }
   952  
   953  // Query returns a query builder for CoinFiatCurrencyHistory.
   954  func (c *CoinFiatCurrencyHistoryClient) Query() *CoinFiatCurrencyHistoryQuery {
   955  	return &CoinFiatCurrencyHistoryQuery{
   956  		config: c.config,
   957  	}
   958  }
   959  
   960  // Get returns a CoinFiatCurrencyHistory entity by its id.
   961  func (c *CoinFiatCurrencyHistoryClient) Get(ctx context.Context, id uint32) (*CoinFiatCurrencyHistory, error) {
   962  	return c.Query().Where(coinfiatcurrencyhistory.ID(id)).Only(ctx)
   963  }
   964  
   965  // GetX is like Get, but panics if an error occurs.
   966  func (c *CoinFiatCurrencyHistoryClient) GetX(ctx context.Context, id uint32) *CoinFiatCurrencyHistory {
   967  	obj, err := c.Get(ctx, id)
   968  	if err != nil {
   969  		panic(err)
   970  	}
   971  	return obj
   972  }
   973  
   974  // Hooks returns the client hooks.
   975  func (c *CoinFiatCurrencyHistoryClient) Hooks() []Hook {
   976  	hooks := c.hooks.CoinFiatCurrencyHistory
   977  	return append(hooks[:len(hooks):len(hooks)], coinfiatcurrencyhistory.Hooks[:]...)
   978  }
   979  
   980  // CoinUsedForClient is a client for the CoinUsedFor schema.
   981  type CoinUsedForClient struct {
   982  	config
   983  }
   984  
   985  // NewCoinUsedForClient returns a client for the CoinUsedFor from the given config.
   986  func NewCoinUsedForClient(c config) *CoinUsedForClient {
   987  	return &CoinUsedForClient{config: c}
   988  }
   989  
   990  // Use adds a list of mutation hooks to the hooks stack.
   991  // A call to `Use(f, g, h)` equals to `coinusedfor.Hooks(f(g(h())))`.
   992  func (c *CoinUsedForClient) Use(hooks ...Hook) {
   993  	c.hooks.CoinUsedFor = append(c.hooks.CoinUsedFor, hooks...)
   994  }
   995  
   996  // Create returns a builder for creating a CoinUsedFor entity.
   997  func (c *CoinUsedForClient) Create() *CoinUsedForCreate {
   998  	mutation := newCoinUsedForMutation(c.config, OpCreate)
   999  	return &CoinUsedForCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1000  }
  1001  
  1002  // CreateBulk returns a builder for creating a bulk of CoinUsedFor entities.
  1003  func (c *CoinUsedForClient) CreateBulk(builders ...*CoinUsedForCreate) *CoinUsedForCreateBulk {
  1004  	return &CoinUsedForCreateBulk{config: c.config, builders: builders}
  1005  }
  1006  
  1007  // Update returns an update builder for CoinUsedFor.
  1008  func (c *CoinUsedForClient) Update() *CoinUsedForUpdate {
  1009  	mutation := newCoinUsedForMutation(c.config, OpUpdate)
  1010  	return &CoinUsedForUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1011  }
  1012  
  1013  // UpdateOne returns an update builder for the given entity.
  1014  func (c *CoinUsedForClient) UpdateOne(cuf *CoinUsedFor) *CoinUsedForUpdateOne {
  1015  	mutation := newCoinUsedForMutation(c.config, OpUpdateOne, withCoinUsedFor(cuf))
  1016  	return &CoinUsedForUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1017  }
  1018  
  1019  // UpdateOneID returns an update builder for the given id.
  1020  func (c *CoinUsedForClient) UpdateOneID(id uint32) *CoinUsedForUpdateOne {
  1021  	mutation := newCoinUsedForMutation(c.config, OpUpdateOne, withCoinUsedForID(id))
  1022  	return &CoinUsedForUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1023  }
  1024  
  1025  // Delete returns a delete builder for CoinUsedFor.
  1026  func (c *CoinUsedForClient) Delete() *CoinUsedForDelete {
  1027  	mutation := newCoinUsedForMutation(c.config, OpDelete)
  1028  	return &CoinUsedForDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1029  }
  1030  
  1031  // DeleteOne returns a builder for deleting the given entity.
  1032  func (c *CoinUsedForClient) DeleteOne(cuf *CoinUsedFor) *CoinUsedForDeleteOne {
  1033  	return c.DeleteOneID(cuf.ID)
  1034  }
  1035  
  1036  // DeleteOne returns a builder for deleting the given entity by its id.
  1037  func (c *CoinUsedForClient) DeleteOneID(id uint32) *CoinUsedForDeleteOne {
  1038  	builder := c.Delete().Where(coinusedfor.ID(id))
  1039  	builder.mutation.id = &id
  1040  	builder.mutation.op = OpDeleteOne
  1041  	return &CoinUsedForDeleteOne{builder}
  1042  }
  1043  
  1044  // Query returns a query builder for CoinUsedFor.
  1045  func (c *CoinUsedForClient) Query() *CoinUsedForQuery {
  1046  	return &CoinUsedForQuery{
  1047  		config: c.config,
  1048  	}
  1049  }
  1050  
  1051  // Get returns a CoinUsedFor entity by its id.
  1052  func (c *CoinUsedForClient) Get(ctx context.Context, id uint32) (*CoinUsedFor, error) {
  1053  	return c.Query().Where(coinusedfor.ID(id)).Only(ctx)
  1054  }
  1055  
  1056  // GetX is like Get, but panics if an error occurs.
  1057  func (c *CoinUsedForClient) GetX(ctx context.Context, id uint32) *CoinUsedFor {
  1058  	obj, err := c.Get(ctx, id)
  1059  	if err != nil {
  1060  		panic(err)
  1061  	}
  1062  	return obj
  1063  }
  1064  
  1065  // Hooks returns the client hooks.
  1066  func (c *CoinUsedForClient) Hooks() []Hook {
  1067  	hooks := c.hooks.CoinUsedFor
  1068  	return append(hooks[:len(hooks):len(hooks)], coinusedfor.Hooks[:]...)
  1069  }
  1070  
  1071  // CurrencyClient is a client for the Currency schema.
  1072  type CurrencyClient struct {
  1073  	config
  1074  }
  1075  
  1076  // NewCurrencyClient returns a client for the Currency from the given config.
  1077  func NewCurrencyClient(c config) *CurrencyClient {
  1078  	return &CurrencyClient{config: c}
  1079  }
  1080  
  1081  // Use adds a list of mutation hooks to the hooks stack.
  1082  // A call to `Use(f, g, h)` equals to `currency.Hooks(f(g(h())))`.
  1083  func (c *CurrencyClient) Use(hooks ...Hook) {
  1084  	c.hooks.Currency = append(c.hooks.Currency, hooks...)
  1085  }
  1086  
  1087  // Create returns a builder for creating a Currency entity.
  1088  func (c *CurrencyClient) Create() *CurrencyCreate {
  1089  	mutation := newCurrencyMutation(c.config, OpCreate)
  1090  	return &CurrencyCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1091  }
  1092  
  1093  // CreateBulk returns a builder for creating a bulk of Currency entities.
  1094  func (c *CurrencyClient) CreateBulk(builders ...*CurrencyCreate) *CurrencyCreateBulk {
  1095  	return &CurrencyCreateBulk{config: c.config, builders: builders}
  1096  }
  1097  
  1098  // Update returns an update builder for Currency.
  1099  func (c *CurrencyClient) Update() *CurrencyUpdate {
  1100  	mutation := newCurrencyMutation(c.config, OpUpdate)
  1101  	return &CurrencyUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1102  }
  1103  
  1104  // UpdateOne returns an update builder for the given entity.
  1105  func (c *CurrencyClient) UpdateOne(cu *Currency) *CurrencyUpdateOne {
  1106  	mutation := newCurrencyMutation(c.config, OpUpdateOne, withCurrency(cu))
  1107  	return &CurrencyUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1108  }
  1109  
  1110  // UpdateOneID returns an update builder for the given id.
  1111  func (c *CurrencyClient) UpdateOneID(id uint32) *CurrencyUpdateOne {
  1112  	mutation := newCurrencyMutation(c.config, OpUpdateOne, withCurrencyID(id))
  1113  	return &CurrencyUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1114  }
  1115  
  1116  // Delete returns a delete builder for Currency.
  1117  func (c *CurrencyClient) Delete() *CurrencyDelete {
  1118  	mutation := newCurrencyMutation(c.config, OpDelete)
  1119  	return &CurrencyDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1120  }
  1121  
  1122  // DeleteOne returns a builder for deleting the given entity.
  1123  func (c *CurrencyClient) DeleteOne(cu *Currency) *CurrencyDeleteOne {
  1124  	return c.DeleteOneID(cu.ID)
  1125  }
  1126  
  1127  // DeleteOne returns a builder for deleting the given entity by its id.
  1128  func (c *CurrencyClient) DeleteOneID(id uint32) *CurrencyDeleteOne {
  1129  	builder := c.Delete().Where(currency.ID(id))
  1130  	builder.mutation.id = &id
  1131  	builder.mutation.op = OpDeleteOne
  1132  	return &CurrencyDeleteOne{builder}
  1133  }
  1134  
  1135  // Query returns a query builder for Currency.
  1136  func (c *CurrencyClient) Query() *CurrencyQuery {
  1137  	return &CurrencyQuery{
  1138  		config: c.config,
  1139  	}
  1140  }
  1141  
  1142  // Get returns a Currency entity by its id.
  1143  func (c *CurrencyClient) Get(ctx context.Context, id uint32) (*Currency, error) {
  1144  	return c.Query().Where(currency.ID(id)).Only(ctx)
  1145  }
  1146  
  1147  // GetX is like Get, but panics if an error occurs.
  1148  func (c *CurrencyClient) GetX(ctx context.Context, id uint32) *Currency {
  1149  	obj, err := c.Get(ctx, id)
  1150  	if err != nil {
  1151  		panic(err)
  1152  	}
  1153  	return obj
  1154  }
  1155  
  1156  // Hooks returns the client hooks.
  1157  func (c *CurrencyClient) Hooks() []Hook {
  1158  	hooks := c.hooks.Currency
  1159  	return append(hooks[:len(hooks):len(hooks)], currency.Hooks[:]...)
  1160  }
  1161  
  1162  // CurrencyFeedClient is a client for the CurrencyFeed schema.
  1163  type CurrencyFeedClient struct {
  1164  	config
  1165  }
  1166  
  1167  // NewCurrencyFeedClient returns a client for the CurrencyFeed from the given config.
  1168  func NewCurrencyFeedClient(c config) *CurrencyFeedClient {
  1169  	return &CurrencyFeedClient{config: c}
  1170  }
  1171  
  1172  // Use adds a list of mutation hooks to the hooks stack.
  1173  // A call to `Use(f, g, h)` equals to `currencyfeed.Hooks(f(g(h())))`.
  1174  func (c *CurrencyFeedClient) Use(hooks ...Hook) {
  1175  	c.hooks.CurrencyFeed = append(c.hooks.CurrencyFeed, hooks...)
  1176  }
  1177  
  1178  // Create returns a builder for creating a CurrencyFeed entity.
  1179  func (c *CurrencyFeedClient) Create() *CurrencyFeedCreate {
  1180  	mutation := newCurrencyFeedMutation(c.config, OpCreate)
  1181  	return &CurrencyFeedCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1182  }
  1183  
  1184  // CreateBulk returns a builder for creating a bulk of CurrencyFeed entities.
  1185  func (c *CurrencyFeedClient) CreateBulk(builders ...*CurrencyFeedCreate) *CurrencyFeedCreateBulk {
  1186  	return &CurrencyFeedCreateBulk{config: c.config, builders: builders}
  1187  }
  1188  
  1189  // Update returns an update builder for CurrencyFeed.
  1190  func (c *CurrencyFeedClient) Update() *CurrencyFeedUpdate {
  1191  	mutation := newCurrencyFeedMutation(c.config, OpUpdate)
  1192  	return &CurrencyFeedUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1193  }
  1194  
  1195  // UpdateOne returns an update builder for the given entity.
  1196  func (c *CurrencyFeedClient) UpdateOne(cf *CurrencyFeed) *CurrencyFeedUpdateOne {
  1197  	mutation := newCurrencyFeedMutation(c.config, OpUpdateOne, withCurrencyFeed(cf))
  1198  	return &CurrencyFeedUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1199  }
  1200  
  1201  // UpdateOneID returns an update builder for the given id.
  1202  func (c *CurrencyFeedClient) UpdateOneID(id uint32) *CurrencyFeedUpdateOne {
  1203  	mutation := newCurrencyFeedMutation(c.config, OpUpdateOne, withCurrencyFeedID(id))
  1204  	return &CurrencyFeedUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1205  }
  1206  
  1207  // Delete returns a delete builder for CurrencyFeed.
  1208  func (c *CurrencyFeedClient) Delete() *CurrencyFeedDelete {
  1209  	mutation := newCurrencyFeedMutation(c.config, OpDelete)
  1210  	return &CurrencyFeedDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1211  }
  1212  
  1213  // DeleteOne returns a builder for deleting the given entity.
  1214  func (c *CurrencyFeedClient) DeleteOne(cf *CurrencyFeed) *CurrencyFeedDeleteOne {
  1215  	return c.DeleteOneID(cf.ID)
  1216  }
  1217  
  1218  // DeleteOne returns a builder for deleting the given entity by its id.
  1219  func (c *CurrencyFeedClient) DeleteOneID(id uint32) *CurrencyFeedDeleteOne {
  1220  	builder := c.Delete().Where(currencyfeed.ID(id))
  1221  	builder.mutation.id = &id
  1222  	builder.mutation.op = OpDeleteOne
  1223  	return &CurrencyFeedDeleteOne{builder}
  1224  }
  1225  
  1226  // Query returns a query builder for CurrencyFeed.
  1227  func (c *CurrencyFeedClient) Query() *CurrencyFeedQuery {
  1228  	return &CurrencyFeedQuery{
  1229  		config: c.config,
  1230  	}
  1231  }
  1232  
  1233  // Get returns a CurrencyFeed entity by its id.
  1234  func (c *CurrencyFeedClient) Get(ctx context.Context, id uint32) (*CurrencyFeed, error) {
  1235  	return c.Query().Where(currencyfeed.ID(id)).Only(ctx)
  1236  }
  1237  
  1238  // GetX is like Get, but panics if an error occurs.
  1239  func (c *CurrencyFeedClient) GetX(ctx context.Context, id uint32) *CurrencyFeed {
  1240  	obj, err := c.Get(ctx, id)
  1241  	if err != nil {
  1242  		panic(err)
  1243  	}
  1244  	return obj
  1245  }
  1246  
  1247  // Hooks returns the client hooks.
  1248  func (c *CurrencyFeedClient) Hooks() []Hook {
  1249  	hooks := c.hooks.CurrencyFeed
  1250  	return append(hooks[:len(hooks):len(hooks)], currencyfeed.Hooks[:]...)
  1251  }
  1252  
  1253  // CurrencyHistoryClient is a client for the CurrencyHistory schema.
  1254  type CurrencyHistoryClient struct {
  1255  	config
  1256  }
  1257  
  1258  // NewCurrencyHistoryClient returns a client for the CurrencyHistory from the given config.
  1259  func NewCurrencyHistoryClient(c config) *CurrencyHistoryClient {
  1260  	return &CurrencyHistoryClient{config: c}
  1261  }
  1262  
  1263  // Use adds a list of mutation hooks to the hooks stack.
  1264  // A call to `Use(f, g, h)` equals to `currencyhistory.Hooks(f(g(h())))`.
  1265  func (c *CurrencyHistoryClient) Use(hooks ...Hook) {
  1266  	c.hooks.CurrencyHistory = append(c.hooks.CurrencyHistory, hooks...)
  1267  }
  1268  
  1269  // Create returns a builder for creating a CurrencyHistory entity.
  1270  func (c *CurrencyHistoryClient) Create() *CurrencyHistoryCreate {
  1271  	mutation := newCurrencyHistoryMutation(c.config, OpCreate)
  1272  	return &CurrencyHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1273  }
  1274  
  1275  // CreateBulk returns a builder for creating a bulk of CurrencyHistory entities.
  1276  func (c *CurrencyHistoryClient) CreateBulk(builders ...*CurrencyHistoryCreate) *CurrencyHistoryCreateBulk {
  1277  	return &CurrencyHistoryCreateBulk{config: c.config, builders: builders}
  1278  }
  1279  
  1280  // Update returns an update builder for CurrencyHistory.
  1281  func (c *CurrencyHistoryClient) Update() *CurrencyHistoryUpdate {
  1282  	mutation := newCurrencyHistoryMutation(c.config, OpUpdate)
  1283  	return &CurrencyHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1284  }
  1285  
  1286  // UpdateOne returns an update builder for the given entity.
  1287  func (c *CurrencyHistoryClient) UpdateOne(ch *CurrencyHistory) *CurrencyHistoryUpdateOne {
  1288  	mutation := newCurrencyHistoryMutation(c.config, OpUpdateOne, withCurrencyHistory(ch))
  1289  	return &CurrencyHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1290  }
  1291  
  1292  // UpdateOneID returns an update builder for the given id.
  1293  func (c *CurrencyHistoryClient) UpdateOneID(id uint32) *CurrencyHistoryUpdateOne {
  1294  	mutation := newCurrencyHistoryMutation(c.config, OpUpdateOne, withCurrencyHistoryID(id))
  1295  	return &CurrencyHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1296  }
  1297  
  1298  // Delete returns a delete builder for CurrencyHistory.
  1299  func (c *CurrencyHistoryClient) Delete() *CurrencyHistoryDelete {
  1300  	mutation := newCurrencyHistoryMutation(c.config, OpDelete)
  1301  	return &CurrencyHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1302  }
  1303  
  1304  // DeleteOne returns a builder for deleting the given entity.
  1305  func (c *CurrencyHistoryClient) DeleteOne(ch *CurrencyHistory) *CurrencyHistoryDeleteOne {
  1306  	return c.DeleteOneID(ch.ID)
  1307  }
  1308  
  1309  // DeleteOne returns a builder for deleting the given entity by its id.
  1310  func (c *CurrencyHistoryClient) DeleteOneID(id uint32) *CurrencyHistoryDeleteOne {
  1311  	builder := c.Delete().Where(currencyhistory.ID(id))
  1312  	builder.mutation.id = &id
  1313  	builder.mutation.op = OpDeleteOne
  1314  	return &CurrencyHistoryDeleteOne{builder}
  1315  }
  1316  
  1317  // Query returns a query builder for CurrencyHistory.
  1318  func (c *CurrencyHistoryClient) Query() *CurrencyHistoryQuery {
  1319  	return &CurrencyHistoryQuery{
  1320  		config: c.config,
  1321  	}
  1322  }
  1323  
  1324  // Get returns a CurrencyHistory entity by its id.
  1325  func (c *CurrencyHistoryClient) Get(ctx context.Context, id uint32) (*CurrencyHistory, error) {
  1326  	return c.Query().Where(currencyhistory.ID(id)).Only(ctx)
  1327  }
  1328  
  1329  // GetX is like Get, but panics if an error occurs.
  1330  func (c *CurrencyHistoryClient) GetX(ctx context.Context, id uint32) *CurrencyHistory {
  1331  	obj, err := c.Get(ctx, id)
  1332  	if err != nil {
  1333  		panic(err)
  1334  	}
  1335  	return obj
  1336  }
  1337  
  1338  // Hooks returns the client hooks.
  1339  func (c *CurrencyHistoryClient) Hooks() []Hook {
  1340  	hooks := c.hooks.CurrencyHistory
  1341  	return append(hooks[:len(hooks):len(hooks)], currencyhistory.Hooks[:]...)
  1342  }
  1343  
  1344  // ExchangeRateClient is a client for the ExchangeRate schema.
  1345  type ExchangeRateClient struct {
  1346  	config
  1347  }
  1348  
  1349  // NewExchangeRateClient returns a client for the ExchangeRate from the given config.
  1350  func NewExchangeRateClient(c config) *ExchangeRateClient {
  1351  	return &ExchangeRateClient{config: c}
  1352  }
  1353  
  1354  // Use adds a list of mutation hooks to the hooks stack.
  1355  // A call to `Use(f, g, h)` equals to `exchangerate.Hooks(f(g(h())))`.
  1356  func (c *ExchangeRateClient) Use(hooks ...Hook) {
  1357  	c.hooks.ExchangeRate = append(c.hooks.ExchangeRate, hooks...)
  1358  }
  1359  
  1360  // Create returns a builder for creating a ExchangeRate entity.
  1361  func (c *ExchangeRateClient) Create() *ExchangeRateCreate {
  1362  	mutation := newExchangeRateMutation(c.config, OpCreate)
  1363  	return &ExchangeRateCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1364  }
  1365  
  1366  // CreateBulk returns a builder for creating a bulk of ExchangeRate entities.
  1367  func (c *ExchangeRateClient) CreateBulk(builders ...*ExchangeRateCreate) *ExchangeRateCreateBulk {
  1368  	return &ExchangeRateCreateBulk{config: c.config, builders: builders}
  1369  }
  1370  
  1371  // Update returns an update builder for ExchangeRate.
  1372  func (c *ExchangeRateClient) Update() *ExchangeRateUpdate {
  1373  	mutation := newExchangeRateMutation(c.config, OpUpdate)
  1374  	return &ExchangeRateUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1375  }
  1376  
  1377  // UpdateOne returns an update builder for the given entity.
  1378  func (c *ExchangeRateClient) UpdateOne(er *ExchangeRate) *ExchangeRateUpdateOne {
  1379  	mutation := newExchangeRateMutation(c.config, OpUpdateOne, withExchangeRate(er))
  1380  	return &ExchangeRateUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1381  }
  1382  
  1383  // UpdateOneID returns an update builder for the given id.
  1384  func (c *ExchangeRateClient) UpdateOneID(id uint32) *ExchangeRateUpdateOne {
  1385  	mutation := newExchangeRateMutation(c.config, OpUpdateOne, withExchangeRateID(id))
  1386  	return &ExchangeRateUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1387  }
  1388  
  1389  // Delete returns a delete builder for ExchangeRate.
  1390  func (c *ExchangeRateClient) Delete() *ExchangeRateDelete {
  1391  	mutation := newExchangeRateMutation(c.config, OpDelete)
  1392  	return &ExchangeRateDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1393  }
  1394  
  1395  // DeleteOne returns a builder for deleting the given entity.
  1396  func (c *ExchangeRateClient) DeleteOne(er *ExchangeRate) *ExchangeRateDeleteOne {
  1397  	return c.DeleteOneID(er.ID)
  1398  }
  1399  
  1400  // DeleteOne returns a builder for deleting the given entity by its id.
  1401  func (c *ExchangeRateClient) DeleteOneID(id uint32) *ExchangeRateDeleteOne {
  1402  	builder := c.Delete().Where(exchangerate.ID(id))
  1403  	builder.mutation.id = &id
  1404  	builder.mutation.op = OpDeleteOne
  1405  	return &ExchangeRateDeleteOne{builder}
  1406  }
  1407  
  1408  // Query returns a query builder for ExchangeRate.
  1409  func (c *ExchangeRateClient) Query() *ExchangeRateQuery {
  1410  	return &ExchangeRateQuery{
  1411  		config: c.config,
  1412  	}
  1413  }
  1414  
  1415  // Get returns a ExchangeRate entity by its id.
  1416  func (c *ExchangeRateClient) Get(ctx context.Context, id uint32) (*ExchangeRate, error) {
  1417  	return c.Query().Where(exchangerate.ID(id)).Only(ctx)
  1418  }
  1419  
  1420  // GetX is like Get, but panics if an error occurs.
  1421  func (c *ExchangeRateClient) GetX(ctx context.Context, id uint32) *ExchangeRate {
  1422  	obj, err := c.Get(ctx, id)
  1423  	if err != nil {
  1424  		panic(err)
  1425  	}
  1426  	return obj
  1427  }
  1428  
  1429  // Hooks returns the client hooks.
  1430  func (c *ExchangeRateClient) Hooks() []Hook {
  1431  	hooks := c.hooks.ExchangeRate
  1432  	return append(hooks[:len(hooks):len(hooks)], exchangerate.Hooks[:]...)
  1433  }
  1434  
  1435  // FiatClient is a client for the Fiat schema.
  1436  type FiatClient struct {
  1437  	config
  1438  }
  1439  
  1440  // NewFiatClient returns a client for the Fiat from the given config.
  1441  func NewFiatClient(c config) *FiatClient {
  1442  	return &FiatClient{config: c}
  1443  }
  1444  
  1445  // Use adds a list of mutation hooks to the hooks stack.
  1446  // A call to `Use(f, g, h)` equals to `fiat.Hooks(f(g(h())))`.
  1447  func (c *FiatClient) Use(hooks ...Hook) {
  1448  	c.hooks.Fiat = append(c.hooks.Fiat, hooks...)
  1449  }
  1450  
  1451  // Create returns a builder for creating a Fiat entity.
  1452  func (c *FiatClient) Create() *FiatCreate {
  1453  	mutation := newFiatMutation(c.config, OpCreate)
  1454  	return &FiatCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1455  }
  1456  
  1457  // CreateBulk returns a builder for creating a bulk of Fiat entities.
  1458  func (c *FiatClient) CreateBulk(builders ...*FiatCreate) *FiatCreateBulk {
  1459  	return &FiatCreateBulk{config: c.config, builders: builders}
  1460  }
  1461  
  1462  // Update returns an update builder for Fiat.
  1463  func (c *FiatClient) Update() *FiatUpdate {
  1464  	mutation := newFiatMutation(c.config, OpUpdate)
  1465  	return &FiatUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1466  }
  1467  
  1468  // UpdateOne returns an update builder for the given entity.
  1469  func (c *FiatClient) UpdateOne(f *Fiat) *FiatUpdateOne {
  1470  	mutation := newFiatMutation(c.config, OpUpdateOne, withFiat(f))
  1471  	return &FiatUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1472  }
  1473  
  1474  // UpdateOneID returns an update builder for the given id.
  1475  func (c *FiatClient) UpdateOneID(id uint32) *FiatUpdateOne {
  1476  	mutation := newFiatMutation(c.config, OpUpdateOne, withFiatID(id))
  1477  	return &FiatUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1478  }
  1479  
  1480  // Delete returns a delete builder for Fiat.
  1481  func (c *FiatClient) Delete() *FiatDelete {
  1482  	mutation := newFiatMutation(c.config, OpDelete)
  1483  	return &FiatDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1484  }
  1485  
  1486  // DeleteOne returns a builder for deleting the given entity.
  1487  func (c *FiatClient) DeleteOne(f *Fiat) *FiatDeleteOne {
  1488  	return c.DeleteOneID(f.ID)
  1489  }
  1490  
  1491  // DeleteOne returns a builder for deleting the given entity by its id.
  1492  func (c *FiatClient) DeleteOneID(id uint32) *FiatDeleteOne {
  1493  	builder := c.Delete().Where(fiat.ID(id))
  1494  	builder.mutation.id = &id
  1495  	builder.mutation.op = OpDeleteOne
  1496  	return &FiatDeleteOne{builder}
  1497  }
  1498  
  1499  // Query returns a query builder for Fiat.
  1500  func (c *FiatClient) Query() *FiatQuery {
  1501  	return &FiatQuery{
  1502  		config: c.config,
  1503  	}
  1504  }
  1505  
  1506  // Get returns a Fiat entity by its id.
  1507  func (c *FiatClient) Get(ctx context.Context, id uint32) (*Fiat, error) {
  1508  	return c.Query().Where(fiat.ID(id)).Only(ctx)
  1509  }
  1510  
  1511  // GetX is like Get, but panics if an error occurs.
  1512  func (c *FiatClient) GetX(ctx context.Context, id uint32) *Fiat {
  1513  	obj, err := c.Get(ctx, id)
  1514  	if err != nil {
  1515  		panic(err)
  1516  	}
  1517  	return obj
  1518  }
  1519  
  1520  // Hooks returns the client hooks.
  1521  func (c *FiatClient) Hooks() []Hook {
  1522  	hooks := c.hooks.Fiat
  1523  	return append(hooks[:len(hooks):len(hooks)], fiat.Hooks[:]...)
  1524  }
  1525  
  1526  // FiatCurrencyClient is a client for the FiatCurrency schema.
  1527  type FiatCurrencyClient struct {
  1528  	config
  1529  }
  1530  
  1531  // NewFiatCurrencyClient returns a client for the FiatCurrency from the given config.
  1532  func NewFiatCurrencyClient(c config) *FiatCurrencyClient {
  1533  	return &FiatCurrencyClient{config: c}
  1534  }
  1535  
  1536  // Use adds a list of mutation hooks to the hooks stack.
  1537  // A call to `Use(f, g, h)` equals to `fiatcurrency.Hooks(f(g(h())))`.
  1538  func (c *FiatCurrencyClient) Use(hooks ...Hook) {
  1539  	c.hooks.FiatCurrency = append(c.hooks.FiatCurrency, hooks...)
  1540  }
  1541  
  1542  // Create returns a builder for creating a FiatCurrency entity.
  1543  func (c *FiatCurrencyClient) Create() *FiatCurrencyCreate {
  1544  	mutation := newFiatCurrencyMutation(c.config, OpCreate)
  1545  	return &FiatCurrencyCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1546  }
  1547  
  1548  // CreateBulk returns a builder for creating a bulk of FiatCurrency entities.
  1549  func (c *FiatCurrencyClient) CreateBulk(builders ...*FiatCurrencyCreate) *FiatCurrencyCreateBulk {
  1550  	return &FiatCurrencyCreateBulk{config: c.config, builders: builders}
  1551  }
  1552  
  1553  // Update returns an update builder for FiatCurrency.
  1554  func (c *FiatCurrencyClient) Update() *FiatCurrencyUpdate {
  1555  	mutation := newFiatCurrencyMutation(c.config, OpUpdate)
  1556  	return &FiatCurrencyUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1557  }
  1558  
  1559  // UpdateOne returns an update builder for the given entity.
  1560  func (c *FiatCurrencyClient) UpdateOne(fc *FiatCurrency) *FiatCurrencyUpdateOne {
  1561  	mutation := newFiatCurrencyMutation(c.config, OpUpdateOne, withFiatCurrency(fc))
  1562  	return &FiatCurrencyUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1563  }
  1564  
  1565  // UpdateOneID returns an update builder for the given id.
  1566  func (c *FiatCurrencyClient) UpdateOneID(id uint32) *FiatCurrencyUpdateOne {
  1567  	mutation := newFiatCurrencyMutation(c.config, OpUpdateOne, withFiatCurrencyID(id))
  1568  	return &FiatCurrencyUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1569  }
  1570  
  1571  // Delete returns a delete builder for FiatCurrency.
  1572  func (c *FiatCurrencyClient) Delete() *FiatCurrencyDelete {
  1573  	mutation := newFiatCurrencyMutation(c.config, OpDelete)
  1574  	return &FiatCurrencyDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1575  }
  1576  
  1577  // DeleteOne returns a builder for deleting the given entity.
  1578  func (c *FiatCurrencyClient) DeleteOne(fc *FiatCurrency) *FiatCurrencyDeleteOne {
  1579  	return c.DeleteOneID(fc.ID)
  1580  }
  1581  
  1582  // DeleteOne returns a builder for deleting the given entity by its id.
  1583  func (c *FiatCurrencyClient) DeleteOneID(id uint32) *FiatCurrencyDeleteOne {
  1584  	builder := c.Delete().Where(fiatcurrency.ID(id))
  1585  	builder.mutation.id = &id
  1586  	builder.mutation.op = OpDeleteOne
  1587  	return &FiatCurrencyDeleteOne{builder}
  1588  }
  1589  
  1590  // Query returns a query builder for FiatCurrency.
  1591  func (c *FiatCurrencyClient) Query() *FiatCurrencyQuery {
  1592  	return &FiatCurrencyQuery{
  1593  		config: c.config,
  1594  	}
  1595  }
  1596  
  1597  // Get returns a FiatCurrency entity by its id.
  1598  func (c *FiatCurrencyClient) Get(ctx context.Context, id uint32) (*FiatCurrency, error) {
  1599  	return c.Query().Where(fiatcurrency.ID(id)).Only(ctx)
  1600  }
  1601  
  1602  // GetX is like Get, but panics if an error occurs.
  1603  func (c *FiatCurrencyClient) GetX(ctx context.Context, id uint32) *FiatCurrency {
  1604  	obj, err := c.Get(ctx, id)
  1605  	if err != nil {
  1606  		panic(err)
  1607  	}
  1608  	return obj
  1609  }
  1610  
  1611  // Hooks returns the client hooks.
  1612  func (c *FiatCurrencyClient) Hooks() []Hook {
  1613  	hooks := c.hooks.FiatCurrency
  1614  	return append(hooks[:len(hooks):len(hooks)], fiatcurrency.Hooks[:]...)
  1615  }
  1616  
  1617  // FiatCurrencyFeedClient is a client for the FiatCurrencyFeed schema.
  1618  type FiatCurrencyFeedClient struct {
  1619  	config
  1620  }
  1621  
  1622  // NewFiatCurrencyFeedClient returns a client for the FiatCurrencyFeed from the given config.
  1623  func NewFiatCurrencyFeedClient(c config) *FiatCurrencyFeedClient {
  1624  	return &FiatCurrencyFeedClient{config: c}
  1625  }
  1626  
  1627  // Use adds a list of mutation hooks to the hooks stack.
  1628  // A call to `Use(f, g, h)` equals to `fiatcurrencyfeed.Hooks(f(g(h())))`.
  1629  func (c *FiatCurrencyFeedClient) Use(hooks ...Hook) {
  1630  	c.hooks.FiatCurrencyFeed = append(c.hooks.FiatCurrencyFeed, hooks...)
  1631  }
  1632  
  1633  // Create returns a builder for creating a FiatCurrencyFeed entity.
  1634  func (c *FiatCurrencyFeedClient) Create() *FiatCurrencyFeedCreate {
  1635  	mutation := newFiatCurrencyFeedMutation(c.config, OpCreate)
  1636  	return &FiatCurrencyFeedCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1637  }
  1638  
  1639  // CreateBulk returns a builder for creating a bulk of FiatCurrencyFeed entities.
  1640  func (c *FiatCurrencyFeedClient) CreateBulk(builders ...*FiatCurrencyFeedCreate) *FiatCurrencyFeedCreateBulk {
  1641  	return &FiatCurrencyFeedCreateBulk{config: c.config, builders: builders}
  1642  }
  1643  
  1644  // Update returns an update builder for FiatCurrencyFeed.
  1645  func (c *FiatCurrencyFeedClient) Update() *FiatCurrencyFeedUpdate {
  1646  	mutation := newFiatCurrencyFeedMutation(c.config, OpUpdate)
  1647  	return &FiatCurrencyFeedUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1648  }
  1649  
  1650  // UpdateOne returns an update builder for the given entity.
  1651  func (c *FiatCurrencyFeedClient) UpdateOne(fcf *FiatCurrencyFeed) *FiatCurrencyFeedUpdateOne {
  1652  	mutation := newFiatCurrencyFeedMutation(c.config, OpUpdateOne, withFiatCurrencyFeed(fcf))
  1653  	return &FiatCurrencyFeedUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1654  }
  1655  
  1656  // UpdateOneID returns an update builder for the given id.
  1657  func (c *FiatCurrencyFeedClient) UpdateOneID(id uint32) *FiatCurrencyFeedUpdateOne {
  1658  	mutation := newFiatCurrencyFeedMutation(c.config, OpUpdateOne, withFiatCurrencyFeedID(id))
  1659  	return &FiatCurrencyFeedUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1660  }
  1661  
  1662  // Delete returns a delete builder for FiatCurrencyFeed.
  1663  func (c *FiatCurrencyFeedClient) Delete() *FiatCurrencyFeedDelete {
  1664  	mutation := newFiatCurrencyFeedMutation(c.config, OpDelete)
  1665  	return &FiatCurrencyFeedDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1666  }
  1667  
  1668  // DeleteOne returns a builder for deleting the given entity.
  1669  func (c *FiatCurrencyFeedClient) DeleteOne(fcf *FiatCurrencyFeed) *FiatCurrencyFeedDeleteOne {
  1670  	return c.DeleteOneID(fcf.ID)
  1671  }
  1672  
  1673  // DeleteOne returns a builder for deleting the given entity by its id.
  1674  func (c *FiatCurrencyFeedClient) DeleteOneID(id uint32) *FiatCurrencyFeedDeleteOne {
  1675  	builder := c.Delete().Where(fiatcurrencyfeed.ID(id))
  1676  	builder.mutation.id = &id
  1677  	builder.mutation.op = OpDeleteOne
  1678  	return &FiatCurrencyFeedDeleteOne{builder}
  1679  }
  1680  
  1681  // Query returns a query builder for FiatCurrencyFeed.
  1682  func (c *FiatCurrencyFeedClient) Query() *FiatCurrencyFeedQuery {
  1683  	return &FiatCurrencyFeedQuery{
  1684  		config: c.config,
  1685  	}
  1686  }
  1687  
  1688  // Get returns a FiatCurrencyFeed entity by its id.
  1689  func (c *FiatCurrencyFeedClient) Get(ctx context.Context, id uint32) (*FiatCurrencyFeed, error) {
  1690  	return c.Query().Where(fiatcurrencyfeed.ID(id)).Only(ctx)
  1691  }
  1692  
  1693  // GetX is like Get, but panics if an error occurs.
  1694  func (c *FiatCurrencyFeedClient) GetX(ctx context.Context, id uint32) *FiatCurrencyFeed {
  1695  	obj, err := c.Get(ctx, id)
  1696  	if err != nil {
  1697  		panic(err)
  1698  	}
  1699  	return obj
  1700  }
  1701  
  1702  // Hooks returns the client hooks.
  1703  func (c *FiatCurrencyFeedClient) Hooks() []Hook {
  1704  	hooks := c.hooks.FiatCurrencyFeed
  1705  	return append(hooks[:len(hooks):len(hooks)], fiatcurrencyfeed.Hooks[:]...)
  1706  }
  1707  
  1708  // FiatCurrencyHistoryClient is a client for the FiatCurrencyHistory schema.
  1709  type FiatCurrencyHistoryClient struct {
  1710  	config
  1711  }
  1712  
  1713  // NewFiatCurrencyHistoryClient returns a client for the FiatCurrencyHistory from the given config.
  1714  func NewFiatCurrencyHistoryClient(c config) *FiatCurrencyHistoryClient {
  1715  	return &FiatCurrencyHistoryClient{config: c}
  1716  }
  1717  
  1718  // Use adds a list of mutation hooks to the hooks stack.
  1719  // A call to `Use(f, g, h)` equals to `fiatcurrencyhistory.Hooks(f(g(h())))`.
  1720  func (c *FiatCurrencyHistoryClient) Use(hooks ...Hook) {
  1721  	c.hooks.FiatCurrencyHistory = append(c.hooks.FiatCurrencyHistory, hooks...)
  1722  }
  1723  
  1724  // Create returns a builder for creating a FiatCurrencyHistory entity.
  1725  func (c *FiatCurrencyHistoryClient) Create() *FiatCurrencyHistoryCreate {
  1726  	mutation := newFiatCurrencyHistoryMutation(c.config, OpCreate)
  1727  	return &FiatCurrencyHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1728  }
  1729  
  1730  // CreateBulk returns a builder for creating a bulk of FiatCurrencyHistory entities.
  1731  func (c *FiatCurrencyHistoryClient) CreateBulk(builders ...*FiatCurrencyHistoryCreate) *FiatCurrencyHistoryCreateBulk {
  1732  	return &FiatCurrencyHistoryCreateBulk{config: c.config, builders: builders}
  1733  }
  1734  
  1735  // Update returns an update builder for FiatCurrencyHistory.
  1736  func (c *FiatCurrencyHistoryClient) Update() *FiatCurrencyHistoryUpdate {
  1737  	mutation := newFiatCurrencyHistoryMutation(c.config, OpUpdate)
  1738  	return &FiatCurrencyHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1739  }
  1740  
  1741  // UpdateOne returns an update builder for the given entity.
  1742  func (c *FiatCurrencyHistoryClient) UpdateOne(fch *FiatCurrencyHistory) *FiatCurrencyHistoryUpdateOne {
  1743  	mutation := newFiatCurrencyHistoryMutation(c.config, OpUpdateOne, withFiatCurrencyHistory(fch))
  1744  	return &FiatCurrencyHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1745  }
  1746  
  1747  // UpdateOneID returns an update builder for the given id.
  1748  func (c *FiatCurrencyHistoryClient) UpdateOneID(id uint32) *FiatCurrencyHistoryUpdateOne {
  1749  	mutation := newFiatCurrencyHistoryMutation(c.config, OpUpdateOne, withFiatCurrencyHistoryID(id))
  1750  	return &FiatCurrencyHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1751  }
  1752  
  1753  // Delete returns a delete builder for FiatCurrencyHistory.
  1754  func (c *FiatCurrencyHistoryClient) Delete() *FiatCurrencyHistoryDelete {
  1755  	mutation := newFiatCurrencyHistoryMutation(c.config, OpDelete)
  1756  	return &FiatCurrencyHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1757  }
  1758  
  1759  // DeleteOne returns a builder for deleting the given entity.
  1760  func (c *FiatCurrencyHistoryClient) DeleteOne(fch *FiatCurrencyHistory) *FiatCurrencyHistoryDeleteOne {
  1761  	return c.DeleteOneID(fch.ID)
  1762  }
  1763  
  1764  // DeleteOne returns a builder for deleting the given entity by its id.
  1765  func (c *FiatCurrencyHistoryClient) DeleteOneID(id uint32) *FiatCurrencyHistoryDeleteOne {
  1766  	builder := c.Delete().Where(fiatcurrencyhistory.ID(id))
  1767  	builder.mutation.id = &id
  1768  	builder.mutation.op = OpDeleteOne
  1769  	return &FiatCurrencyHistoryDeleteOne{builder}
  1770  }
  1771  
  1772  // Query returns a query builder for FiatCurrencyHistory.
  1773  func (c *FiatCurrencyHistoryClient) Query() *FiatCurrencyHistoryQuery {
  1774  	return &FiatCurrencyHistoryQuery{
  1775  		config: c.config,
  1776  	}
  1777  }
  1778  
  1779  // Get returns a FiatCurrencyHistory entity by its id.
  1780  func (c *FiatCurrencyHistoryClient) Get(ctx context.Context, id uint32) (*FiatCurrencyHistory, error) {
  1781  	return c.Query().Where(fiatcurrencyhistory.ID(id)).Only(ctx)
  1782  }
  1783  
  1784  // GetX is like Get, but panics if an error occurs.
  1785  func (c *FiatCurrencyHistoryClient) GetX(ctx context.Context, id uint32) *FiatCurrencyHistory {
  1786  	obj, err := c.Get(ctx, id)
  1787  	if err != nil {
  1788  		panic(err)
  1789  	}
  1790  	return obj
  1791  }
  1792  
  1793  // Hooks returns the client hooks.
  1794  func (c *FiatCurrencyHistoryClient) Hooks() []Hook {
  1795  	hooks := c.hooks.FiatCurrencyHistory
  1796  	return append(hooks[:len(hooks):len(hooks)], fiatcurrencyhistory.Hooks[:]...)
  1797  }
  1798  
  1799  // SettingClient is a client for the Setting schema.
  1800  type SettingClient struct {
  1801  	config
  1802  }
  1803  
  1804  // NewSettingClient returns a client for the Setting from the given config.
  1805  func NewSettingClient(c config) *SettingClient {
  1806  	return &SettingClient{config: c}
  1807  }
  1808  
  1809  // Use adds a list of mutation hooks to the hooks stack.
  1810  // A call to `Use(f, g, h)` equals to `setting.Hooks(f(g(h())))`.
  1811  func (c *SettingClient) Use(hooks ...Hook) {
  1812  	c.hooks.Setting = append(c.hooks.Setting, hooks...)
  1813  }
  1814  
  1815  // Create returns a builder for creating a Setting entity.
  1816  func (c *SettingClient) Create() *SettingCreate {
  1817  	mutation := newSettingMutation(c.config, OpCreate)
  1818  	return &SettingCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1819  }
  1820  
  1821  // CreateBulk returns a builder for creating a bulk of Setting entities.
  1822  func (c *SettingClient) CreateBulk(builders ...*SettingCreate) *SettingCreateBulk {
  1823  	return &SettingCreateBulk{config: c.config, builders: builders}
  1824  }
  1825  
  1826  // Update returns an update builder for Setting.
  1827  func (c *SettingClient) Update() *SettingUpdate {
  1828  	mutation := newSettingMutation(c.config, OpUpdate)
  1829  	return &SettingUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1830  }
  1831  
  1832  // UpdateOne returns an update builder for the given entity.
  1833  func (c *SettingClient) UpdateOne(s *Setting) *SettingUpdateOne {
  1834  	mutation := newSettingMutation(c.config, OpUpdateOne, withSetting(s))
  1835  	return &SettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1836  }
  1837  
  1838  // UpdateOneID returns an update builder for the given id.
  1839  func (c *SettingClient) UpdateOneID(id uint32) *SettingUpdateOne {
  1840  	mutation := newSettingMutation(c.config, OpUpdateOne, withSettingID(id))
  1841  	return &SettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1842  }
  1843  
  1844  // Delete returns a delete builder for Setting.
  1845  func (c *SettingClient) Delete() *SettingDelete {
  1846  	mutation := newSettingMutation(c.config, OpDelete)
  1847  	return &SettingDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1848  }
  1849  
  1850  // DeleteOne returns a builder for deleting the given entity.
  1851  func (c *SettingClient) DeleteOne(s *Setting) *SettingDeleteOne {
  1852  	return c.DeleteOneID(s.ID)
  1853  }
  1854  
  1855  // DeleteOne returns a builder for deleting the given entity by its id.
  1856  func (c *SettingClient) DeleteOneID(id uint32) *SettingDeleteOne {
  1857  	builder := c.Delete().Where(setting.ID(id))
  1858  	builder.mutation.id = &id
  1859  	builder.mutation.op = OpDeleteOne
  1860  	return &SettingDeleteOne{builder}
  1861  }
  1862  
  1863  // Query returns a query builder for Setting.
  1864  func (c *SettingClient) Query() *SettingQuery {
  1865  	return &SettingQuery{
  1866  		config: c.config,
  1867  	}
  1868  }
  1869  
  1870  // Get returns a Setting entity by its id.
  1871  func (c *SettingClient) Get(ctx context.Context, id uint32) (*Setting, error) {
  1872  	return c.Query().Where(setting.ID(id)).Only(ctx)
  1873  }
  1874  
  1875  // GetX is like Get, but panics if an error occurs.
  1876  func (c *SettingClient) GetX(ctx context.Context, id uint32) *Setting {
  1877  	obj, err := c.Get(ctx, id)
  1878  	if err != nil {
  1879  		panic(err)
  1880  	}
  1881  	return obj
  1882  }
  1883  
  1884  // Hooks returns the client hooks.
  1885  func (c *SettingClient) Hooks() []Hook {
  1886  	hooks := c.hooks.Setting
  1887  	return append(hooks[:len(hooks):len(hooks)], setting.Hooks[:]...)
  1888  }
  1889  
  1890  // TranClient is a client for the Tran schema.
  1891  type TranClient struct {
  1892  	config
  1893  }
  1894  
  1895  // NewTranClient returns a client for the Tran from the given config.
  1896  func NewTranClient(c config) *TranClient {
  1897  	return &TranClient{config: c}
  1898  }
  1899  
  1900  // Use adds a list of mutation hooks to the hooks stack.
  1901  // A call to `Use(f, g, h)` equals to `tran.Hooks(f(g(h())))`.
  1902  func (c *TranClient) Use(hooks ...Hook) {
  1903  	c.hooks.Tran = append(c.hooks.Tran, hooks...)
  1904  }
  1905  
  1906  // Create returns a builder for creating a Tran entity.
  1907  func (c *TranClient) Create() *TranCreate {
  1908  	mutation := newTranMutation(c.config, OpCreate)
  1909  	return &TranCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1910  }
  1911  
  1912  // CreateBulk returns a builder for creating a bulk of Tran entities.
  1913  func (c *TranClient) CreateBulk(builders ...*TranCreate) *TranCreateBulk {
  1914  	return &TranCreateBulk{config: c.config, builders: builders}
  1915  }
  1916  
  1917  // Update returns an update builder for Tran.
  1918  func (c *TranClient) Update() *TranUpdate {
  1919  	mutation := newTranMutation(c.config, OpUpdate)
  1920  	return &TranUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1921  }
  1922  
  1923  // UpdateOne returns an update builder for the given entity.
  1924  func (c *TranClient) UpdateOne(t *Tran) *TranUpdateOne {
  1925  	mutation := newTranMutation(c.config, OpUpdateOne, withTran(t))
  1926  	return &TranUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1927  }
  1928  
  1929  // UpdateOneID returns an update builder for the given id.
  1930  func (c *TranClient) UpdateOneID(id uint32) *TranUpdateOne {
  1931  	mutation := newTranMutation(c.config, OpUpdateOne, withTranID(id))
  1932  	return &TranUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1933  }
  1934  
  1935  // Delete returns a delete builder for Tran.
  1936  func (c *TranClient) Delete() *TranDelete {
  1937  	mutation := newTranMutation(c.config, OpDelete)
  1938  	return &TranDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
  1939  }
  1940  
  1941  // DeleteOne returns a builder for deleting the given entity.
  1942  func (c *TranClient) DeleteOne(t *Tran) *TranDeleteOne {
  1943  	return c.DeleteOneID(t.ID)
  1944  }
  1945  
  1946  // DeleteOne returns a builder for deleting the given entity by its id.
  1947  func (c *TranClient) DeleteOneID(id uint32) *TranDeleteOne {
  1948  	builder := c.Delete().Where(tran.ID(id))
  1949  	builder.mutation.id = &id
  1950  	builder.mutation.op = OpDeleteOne
  1951  	return &TranDeleteOne{builder}
  1952  }
  1953  
  1954  // Query returns a query builder for Tran.
  1955  func (c *TranClient) Query() *TranQuery {
  1956  	return &TranQuery{
  1957  		config: c.config,
  1958  	}
  1959  }
  1960  
  1961  // Get returns a Tran entity by its id.
  1962  func (c *TranClient) Get(ctx context.Context, id uint32) (*Tran, error) {
  1963  	return c.Query().Where(tran.ID(id)).Only(ctx)
  1964  }
  1965  
  1966  // GetX is like Get, but panics if an error occurs.
  1967  func (c *TranClient) GetX(ctx context.Context, id uint32) *Tran {
  1968  	obj, err := c.Get(ctx, id)
  1969  	if err != nil {
  1970  		panic(err)
  1971  	}
  1972  	return obj
  1973  }
  1974  
  1975  // Hooks returns the client hooks.
  1976  func (c *TranClient) Hooks() []Hook {
  1977  	hooks := c.hooks.Tran
  1978  	return append(hooks[:len(hooks):len(hooks)], tran.Hooks[:]...)
  1979  }