package
0.0.0-20230111045308-694567495a48
Repository: https://github.com/phogolabs/orm.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# Functions
AlterIndex returns a query builder for the `ALTER INDEX` statement.
AlterTable returns a query builder for the `ALTER TABLE` statement.
And combines all given predicates with AND between them.
As suffixed the given column with an alias (`a` AS `b`).
Asc adds the ASC suffix for the given column.
Avg wraps the ident with the AVG aggregation function.
Column returns a new ColumnBuilder with the given name.
ColumnsEQ appends a "=" predicate between 2 columns.
ColumnsGT appends a ">" predicate between 2 columns.
ColumnsGTE appends a ">=" predicate between 2 columns.
ColumnsLT appends a "<" predicate between 2 columns.
ColumnsLTE appends a "<=" predicate between 2 columns.
ColumnsNEQ appends a "<>" predicate between 2 columns.
ColumnsOp returns a new predicate between 2 columns.
CompositeGT returns a composite ">" predicate.
CompositeLT returns a composite "<" predicate.
ConflictColumns sets the unique constraints that trigger the conflict resolution on insert to perform an upsert operation.
ConflictConstraint allows setting the constraint name (i.e.
ConflictWhere allows inference of partial unique indexes.
Contains is a helper predicate that checks substring using the LIKE predicate.
ContainsFold is a helper predicate that checks substring using the LIKE predicate.
Count wraps the ident with the COUNT aggregation function.
CreateIndex creates a builder for the `CREATE INDEX` statement.
CreateTable returns a query builder for the `CREATE TABLE` statement.
Delete creates a builder for the `DELETE` statement.
Desc adds the DESC suffix for the given column.
Describe returns a query builder for the `DESCRIBE` statement.
Dialect creates a new DialectBuilder with the given dialect name.
Distinct prefixed the given columns with the `DISTINCT` keyword (DISTINCT `id`).
DoNothing configures the conflict_action to `DO NOTHING`.
DropIndex creates a builder for the `DROP INDEX` statement.
EQ returns a "=" predicate.
EqualFold is a helper predicate that applies the "=" predicate with case-folding.
Exists returns the `Exists` predicate.
Expr returns an SQL expression that implements the Querier interface.
ExprFunc returns an expression function that implements the Querier interface.
ExprP creates a new predicate from the given expression.
False appends the FALSE keyword to the predicate.
ForeignKey returns a builder for the foreign-key constraint clause in create/alter table statements.
State returns the entity state Accoring to StackOverflow the now() function is transactional so in order to find out whether the contact has been changed we should just check whether both created_at == updated_at
ref: https://stackoverflow.com/a/49935987.
GT returns a ">" predicate.
GTE returns a ">=" predicate.
HasPrefix is a helper predicate that checks prefix using the LIKE predicate.
HasSuffix is a helper predicate that checks suffix using the LIKE predicate.
In returns the `IN` predicate.
InInts returns the `IN` predicate for ints.
Insert creates a builder for the `INSERT INTO` statement.
InValues adds the `IN` predicate for slice of driver.Value.
IsNull returns the `IS NULL` predicate.
Like returns the `LIKE` predicate.
Lower wraps the given column with the LOWER function.
LT returns a "<" predicate.
LTE returns a "<=" predicate.
Max wraps the ident with the MAX aggregation function.
Min wraps the ident with the MIN aggregation function.
NEQ returns a "<>" predicate.
NewDelete creates a Mutation that deletes the entity with given primary key.
NewInsert creates a Mutation that will save the entity src into the db.
NewUpdate creates a Mutation that updates the entity into the db.
Not wraps the given predicate with the not predicate.
NotExists returns the `NotExists` predicate.
NotIn returns the `Not IN` predicate.
NotNull returns the `IS NOT NULL` predicate.
Open wraps the database/sql.Open method and returns a dialect.Driver that implements the an ent/dialect.Driver interface.
OpenDB wraps the given database/sql.DB method with a Driver.
Or combines all given predicates with OR between them.
OrderBy returns an order by.
OrderColumnBy returns a order column.
OrderWith returns an order from.
P creates a new predicate.
ProjectBy returns a seelect by.
ProjectColumnBy returns a new column selector.
Query create a new named query.
Raw returns a raw SQL query that is placed as-is in the query.
Reference create a reference builder for the reference_option clause.
ResolveWith allows setting a custom function to set the `UPDATE` clause.
ResolveWithEntity resolves the conflict with the entity provided values.
ResolveWithIgnore sets each column to itself to force an update and return the ID, otherwise does not change any data.
ResolveWithNewValues updates columns using the new values proposed for insertion using the special EXCLUDED/VALUES table.
Routine create a new routine for given name.
Select returns a new selector for the `SELECT` statement.
SelectExpr is like Select, but supports passing arbitrary expressions for SELECT clause.
SelectionBy returns a new selection.
SelectionWith creates a selection.
Sum wraps the ident with the SUM aggregation function.
Table returns a new table selector.
Update creates a builder for the `UPDATE` statement.
UpdateWhere allows setting the an update condition.
With returns a new builder for the `WITH` statement.
WithLockAction sets the Action of the lock.
WithLockClause allows providing a custom clause for locking the statement.
WithLockTables sets the Tables of the lock.
WithRecursive returns a new builder for the `WITH RECURSIVE` statement.
# Constants
EntityStateCreated: the entity is being tracked by the context but does not yet exist in the database.
EntityStateDetached: the entity is being tracked by the context and exists in the database, but has been marked for deletion from the database the next time SaveChanges is called.
EntityStateUpdated: the entity is being tracked by the context and exists in the database, and some or all of its property values have been modified.
A list of all locking clauses.
A list of all locking clauses.
A list of all locking clauses.
A list of all locking clauses.
NoWait means never wait and returns an error.
+.
/ (Quotient).
=.
>.
>=.
IN.
IS NULL.
LIKE.
<.
<=.
% (Reminder).
*.
<>.
NOT IN.
IS NOT NULL.
-.
SkipLocked means never wait and skip.
# Variables
ErrNoRows is returned by Scan when QueryRow doesn't return a row.
# Structs
Builder is the base query builder for the sql dsl.
ColumnBuilder is a builder for column definition in table creation.
Conn implements dialect.ExecQuerier given ExecQuerier.
Cursor represents the pagination position.
DeleteBuilder is a builder for `DELETE` statement.
DeleteMutation represents a delete mutation.
DescribeBuilder is a query builder for `DESCRIBE` statement.
DialectBuilder prefixes all root builders with the `Dialect` constructor.
Driver is a dialect.Driver implementation for SQL based databases.
DropIndexBuilder is a builder for `DROP INDEX` statement.
ForeignKeyBuilder is the builder for the foreign-key constraint clause.
Func represents an SQL function.
IndexAlter is a query builder for `ALTER INDEX` statement.
IndexBuilder is a builder for `CREATE INDEX` statement.
InsertBuilder is a builder for `INSERT INTO` statement.
InsertMutation represents an insert mutation.
No description provided by the author
NamedQuery is a named query that uses named arguments.
NullScanner represents an sql.Scanner that may be null.
Order represents an order.
OrderColumn represents an order by column.
PaginateTable paginates a given selector.
Predicate is a where predicate.
ProjectColumn is a column selector.
Projection represents an order.
ReferenceBuilder is a builder for the reference clause in constraints.
RoutineQuery represents a named routine.
No description provided by the author
Selection represents a selection.
Selector is a builder for the `SELECT` statement.
SelectTable is a table selector.
No description provided by the author
TableAlter is a query builder for `ALTER TABLE` statement.
TableBuilder is a query builder for `CREATE TABLE` statement.
Tx implements dialect.Tx interface.
UpdateBuilder is a builder for `UPDATE` statement.
UpdateMutation represents an update mutation.
UpdateSet describes a set of changes of the `DO UPDATE` clause.
WithBuilder is the builder for the `WITH` statement.
Wrapper wraps a given Querier with different format.
# Interfaces
ColumnScanner is the interface that wraps the standard sql.Rows methods used for scanning database rows.
Entity represents an entity.
ExecQuerier wraps the standard Exec and Query methods.
No description provided by the author
Querier wraps the basic Query method that is implemented by the different builders in this file.
TableView is a view that returns a table view.
# Type aliases
No description provided by the author
EntityState is the entity state.
FileSystem represents the SQL filesystem.
LockAction tells the transaction what to do in case of requesting a row that is locked by other transaction.
No description provided by the author
LockStrength defines the strength of the lock (see the list below).
A NamedArg is a named argument.
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
An Op represents an operator.
Provider represents a routine provider.
Queries are list of queries join with space between them.
No description provided by the author
SelectorFunc represents a selector function.
No description provided by the author