package
0.0.0-20250318101222-61bbd06eddc8
Repository: https://github.com/eaglebush/querybuilder.git
Documentation: pkg.go.dev

# README

querybuilder

Build queries for SQL-based databases such as SQL Server and SQLite.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

# Functions

Command sets the command of a query builder.
Constants are builder settings that follows the database engine settings.
Config sets the database info.
Default is the default value of the column when the value encounters a nil.
InitConstants return defaults of database engine constants, with database configuration if present.
Interpolate converts all table name with {} around it will be prepended with schema and reference code prefix.
InterpolateTable - interpolate the tables specified with curly braces {} with a schema.
IsSqlString sets if the value is an SQL string.
MatchToNull is the condition the primary value matches with this value, the resulting value will be set to NULL.
New builds a new QueryBuilder.
NewDelete is a shortcut builder for Delete queries.
NewInsert is a shortcut builder for Insert queries.
NewSelect is a shortcut builder for Select queries dataObject can be a table, view or a joined query name.
NewUpdate is a shortcut builder for Update queries.
ParseReserveWordsChars always returns two-element array of opening and closing escape chars.
ReferenceMode enables the builder to generate query that adds a `ref` prefix to table names after the schema.
ReferenceModePrefix changes the reference prefix to add to database object names when set in ReferenceMode Warning: If the interpolation is set to off, this property is ignored.
Schema sets the schema of a query builder.
SkipNilWrite sets the condition to skip nil columns when writing to table.
Source sets the table, view or stored procedure name.
Spawn creates a copy of a builder and resets the non-constant values.
SpawnDelete creates a new builder out of factory and initializes for delete command.
SpawnInsert creates a new builder out of factory and initializes for insert command.
SpawnSelect creates a new builder out of factory and initializes for query dataObject can be a table, view or a joined query name.
SpawnUpdate creates a new builder out of factory and initializes for update command.

# Constants

Sort enum.
Delete record type.
Sort enum.
Limit enum.
Insert record type.
Limit enum.
Select record type.
Update record type.

# Variables

# Structs

No description provided by the author
QueryBuilder is a structure to build SQL queries.
No description provided by the author
ValueCompareOption options for adding values.

# Type aliases

No description provided by the author
No description provided by the author
Option function for QueryBuilder.
No description provided by the author
No description provided by the author