package
0.0.0-20230101183712-202847b4b89b
Repository: https://github.com/corestoreio/pkg.git
Documentation: pkg.go.dev
# Functions
Column adds a new condition.
Columns add syntactic sugar to a JOIN or ON DUPLICATE KEY statement: In case of JOIN: The USING(column_list) clause names a list of columns that must exist in both tables.
DBRValidateMinAffectedRow is an option argument to provide a basic helper function to check that at least one row has been deleted.
No description provided by the author
ExecValidateOneAffectedRow checks the sql.Result.RowsAffected if it returns one.
Expr adds an unquoted SQL expression to a column, WHERE, HAVING, SET or ON DUPLICATE KEY statement.
FromContextQueryOptions returns the options from the context.
Interpolate takes a SQL byte slice with placeholders and a list of arguments to replace them with.
IsValidIdentifier checks the permissible syntax for identifiers.
MakeIdentifier creates a new quoted name with an optional alias `a`, which can be empty.
MustConnectAndVerify at like NewConnPool but it verifies the connection and panics on errors.
MySQLMessageFromError returns the textual message of the MySQL error.
MySQLNumberFromError returns the error code number from an error.
NewColumnMap exported for testing reasons.
NewConnPool instantiates a ConnPool for a given database/sql connection and event receiver.
NewDelete creates a new Delete object.
NewInsert creates a new Insert object.
NewSelect creates a new Select object.
NewSelectWithDerivedTable creates a new derived table (Subquery in the FROM Clause) using the provided sub-select in the FROM part together with an alias name.
NewShow creates a new Truman SHOW.
NewUnion creates a new Union object.
NewUpdate creates a new Update object.
NewWith creates a new WITH statement with multiple common table expressions (CTE).
ParenthesisClose sets a closing parenthesis ")".
ParenthesisOpen sets an open parenthesis "(".
Qualify provides a more concise way to create QualifiedRecord values.
SQLCase generates a CASE ..
SQLIf writes a SQL IF() expression.
SQLIfNull creates an IFNULL expression.
WithContextQueryOptions adds options for executing queries, mostly in generated code.
WithCreateDatabase creates the database and sets the utf8mb4 option.
WithDB sets the DB value to an existing connection.
WithDriverCallBack allows low level query logging and argument inspection.
WithDSN sets the data source name for a connection.
WithDSNFromEnv loads the DSN string from an environment variable named by `dsnEnvName`.
WithExecSQLOnConnClose runs the sqlQuery arguments before closing a DB connection.
WithExecSQLOnConnOpen runs the sqlQuery arguments after successful opening a DB connection.
WithLogger sets the customer logger to be used across the package.
WithSetNamesUTF8MB4 sets the utf8mb4 charset and collation.
WithVerifyConnection checks if the connection to the server is valid and can be established.
# Constants
BETWEEN ? AND ?.
Returns the first non-NULL value in the list, or NULL if there are no non-NULL arguments.
Those four constants represents the modes for ColumnMap.Mode.
Those four constants represents the modes for ColumnMap.Mode.
Those four constants represents the modes for ColumnMap.Mode.
can be used for both.
EnvDSN is the name of the environment variable.
= ?.
EventFlag constants define the concrete locations of dispatched events.
EventFlag constants define the concrete locations of dispatched events.
EventFlag constants define the concrete locations of dispatched events.
EventFlag constants define the concrete locations of dispatched events.
EventFlag constants define the concrete locations of dispatched events.
EventFlag constants define the concrete locations of dispatched events.
EventFlag constants define the concrete locations of dispatched events.
EventFlag constants define the concrete locations of dispatched events.
EventFlag constants define the concrete locations of dispatched events.
EventFlag constants define the concrete locations of dispatched events.
indicates maximum events available.
EventFlag constants define the concrete locations of dispatched events.
EXISTS(subquery).
>.
>=.
GREATEST(?,?,?) returns NULL if any value is NULL.
IN ?.
LEAST(?,?,?) If any value is NULL, the result is NULL.
<.
<=.
LIKE ?.
MaxIdentifierLength see http://dev.mysql.com/doc/refman/5.7/en/identifiers.html.
NOT BETWEEN ? AND ?.
!= ?.
NOT EXISTS(subquery).
NOT IN ?.
NOT LIKE ?.
IS NOT NULL.
NOT REGEXP ?.
IS NULL.
REGEXP ?.
a <=> b is equivalent to a = b OR (a IS NULL AND b IS NULL) NULL-safe equal to operator.
XOR ?.
# Structs
BuilderBase contains fields which all SQL query builder have in common, the same base.
BuilderConditional defines base fields used in statements which can have conditional constraints like WHERE, JOIN, ORDER, etc.
ColumnMap takes care that the table/view/identifiers are getting properly mapped to ColumnMapper interface.
Condition implements a single condition often used in WHERE, ON, SET and ON DUPLICATE KEY UPDATE.
Conn represents a single database session rather a pool of database sessions.
ConnPool at a connection to the database with an EventReceiver to send events, errors, and timings to.
ConnPoolOption can be used at an argument in NewConnPool to configure a connection.
DBR is a DataBaseRunner which prepares the SQL string from a DML type, collects and build a list of arguments for later sending and execution in the database server.
Delete contains the clauses for a DELETE statement.
No description provided by the author
Insert contains the clauses for an INSERT statement.
MysqlQuoter implements Mysql-specific quoting.
QualifiedRecord is a ColumnMapper with a qualifier.
QueryOptions provides different options while executing code for SQL queries.
Select contains the clauses for a SELECT statement.
Show represents the SHOW syntax.
StaticSQLResult implements sql.Result for mocking reasons.
Stmt wraps a *sql.Stmt (a prepared statement) with a specific SQL query.
Tx is an in-progress database transaction.
Union represents a UNION SQL statement.
Update contains the logic for an UPDATE statement.
With represents a common table expression.
WithCTE defines a common table expression used in the type `With`.
# Interfaces
ColumnMapper allows a type to load data from database query into its fields or return the fields values as arguments for a query.
Execer can execute a non-returning query.
LastInsertIDAssigner assigns the last insert ID of an auto increment column back to the objects.
Preparer prepares a query in the server.
Querier can execute a returning query.
QueryBuilder assembles a query and returns the raw SQL without parameter substitution and the arguments.
QueryExecPreparer can execute a returning query and prepare a returning query.
StmtExecer executes a prepared statement.
StmtQuerier executes a prepared statement query.
# Type aliases
Conditions provides a list where the left hand side gets an assignment from the right hand side.
DBRFunc defines a call back function used in other packages to allow modifications to the DBR object.
DriverCallBack defines the call back signature used in every driver function.
EventFlag describes where and when an event might get dispatched.
Joins defines multiple join conditions.
Op the Operator, defines comparison and operator functions used in any conditions.
QuerySQL simple type to satisfy the QueryBuilder interface.
QuerySQL a helper type to transform a string into a QueryBuilder compatible type.