package
0.0.0-20230605045656-66b15f905e3e
Repository: https://github.com/jimmc/jraceman.git
Documentation: pkg.go.dev

# Functions

ColumnInfo generates a list of column names and other info from the given struct.
ColumnInfosDiffer returns true if any of the fields of the two args differ.
ColumnInfosToMap takes an array of ColumnInfo and returns a map of those structures using the Name field as the key.
ColumnNames generates a list of column names based on the fields of the given struct.
ColumnSpec generates an sql column specification, suitable for use in a CREATE TABLE or ALTER TABLE command, for the given ColumnInfo.
CreateOrUpgradeTableSql checks to see whether the table already exists, and returns either a CREATE TABLE statement if it does not exist, or the ALTER TABLE statements for column changes if it does exist.
CreateTable creates a table with the given name and with columns based on the fields of the given entity by using the sql string generated by CreateTableSql.
CreateTableSql generates an SQL CREATE TABLE command using the fields of the given struct.
CreateTableSql generates an SQL CREATE TABLE command using the given column info.
CreateTableSqlWithUpdater generates an SQL CREATE TABLE command using the fields of the given struct modified by the updater.
CreateTableWithUpdater creates a table with the given name and with columns based on the fields of the given entity by using the sql string generated by CreateTableSqlWithUpdater.
DeleteByID deletes a record by ID.
DeleteByIDSql generates an SQL DELETE statement.
DiffColumnInfos compares two arrays of ColumnInfo and returns a struct with info on what needs to be done to go from got to want.
FindByIDSql generates an SQL QUERY statement, with a WHERE clause limiting it to a matching id, using the fields of the given struct.
Insert inserts a new row into the database using the sql string generated by InsertSql.
InsertSql generates an SQL INSERT statement using the fields of the given struct.
ListSql generates an SQL QUERY statement, with OFFSET and LIMIT clauses, using the fields of the given struct.
ModsToSql takes a map of the modifications from Diffs and generates the sql string and values to be executed to perform the update.
NumberNotIn returns a number which is not in the given array.
RequireOneResult gets the result of sql.Stmt.Exec and verifies that it affected exactly one row, which should be the case for operations that use the entity ID.
SelectSql generates an SQL SELECT statement using the fields of the given struct.
TableColumns collects details about the current columns in the database for the specified table, and returns them in the same form as ColumnInfos.
TableExists returns true of the specified table exists in the database.
UniqueID returns a unique id within the table, following the id pattern given but using a different trailing number if necessary.
UpdateByID updates a record by ID.
UpgradeTable upgrades a table from its current state to match what CreateTable would create.
UpgradeTableSql generates an SQL a create or upgrade command using the fields of the given struct.
UpgradeTableWithUpdater upgrades a table from its current state to match what CreateTableWithUpdater would create.

# Structs

ColumnInfo describes the attributes of a database column.
ColumnInfosDiff describes how to change from one []ColumnInfo to another []ColumnInfo by matching up the Name fields.

# Interfaces

No description provided by the author