Categorygithub.com/driver005/database
modulepackage
1.0.6
Repository: https://github.com/driver005/database.git
Documentation: pkg.go.dev

# README

Database

Go Reference

I know it's one of the bades names for an ORM

Overview

  • Full-Featured ORM
  • Associations (Has One, Has Many, Belongs To, Many To Many, Polymorphism, Single-table inheritance)
  • Hooks (Before/After Create/Save/Update/Delete/Find)
  • Eager loading with Preload, Joins
  • Transactions, Nested Transactions, Save Point, RollbackTo to Saved Point
  • Context, Prepared Statement Mode, DryRun Mode
  • Batch Insert, FindInBatches, Find To Map
  • SQL Builder, Upsert, Locking, Optimizer/Index/Comment Hints, NamedArg, Search/Update/Create with SQL Expr
  • Composite Primary Key
  • Auto Migrations
  • Logger
  • Extendable, flexible plugin API: Database Resolver (Multiple Databases, Read/Write Splitting) / Prometheus…
  • Every feature comes with tests
  • Developer Friendly

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

Expr returns clause.Expr, which can be used to pass SQL expression as params.
Open initialize db session based on dialector.
Scan scan rows into db statement.

# Constants

# Variables

ErrDryRunModeUnsupported dry run mode unsupported.
ErrEmptySlice empty slice found.
ErrInvalidData unsupported data.
ErrInvalidDB invalid db.
ErrInvalidField invalid field.
ErrInvalidTransaction invalid transaction when you are trying to `Commit` or `Rollback`.
ErrInvalidValue invalid value.
ErrInvalidValueOfLength invalid values do not match length.
ErrMissingWhereClause missing where clause.
ErrModelValueRequired model value required.
ErrNotImplemented not implemented.
ErrPreloadNotAllowed preload is not allowed when count is used.
ErrPrimaryKeyRequired primary keys required.
ErrRecordNotFound record not found error.
ErrRegistered registered.
ErrUnsupportedDriver unsupported driver.
ErrUnsupportedRelation unsupported relations.

# Structs

Association Mode contains some helper methods to handle relationship things easily.
Config GORM config.
DB GORM DB definition.
Model a basic GoLang struct which includes the following fields: ID, CreatedAt, UpdatedAt, DeletedAt It may be embedded into your model or you may build your own model without it type User struct { database.Model }.
No description provided by the author
No description provided by the author
Session session config when create session with Session() method.
No description provided by the author
No description provided by the author
No description provided by the author
Statement statement.
No description provided by the author
ViewOption view option.

# Interfaces

ColumnType column type interface.
ConnPool db conns pool interface.
ConnPoolBeginner conn pool beginner.
Dialector Database database dialector.
GetDBConnector SQL db connector.
No description provided by the author
Migrator migrator interface.
Option gorm option interface.
Plugin Database plugin interface.
Rows rows interface.
SavePointerDialectorInterface save pointer interface.
StatementModifier statement modifier interface.
Tx sql.Tx interface.
TxBeginner tx beginner.
TxCommitter tx committer.
Valuer database valuer interface.

# Type aliases

No description provided by the author
ScanMode scan data mode.