@onzag/itemize / Modules / database/base / QueryBuilder
database/base.QueryBuilder
Reprents the basic query builder to build a bit of a query or the entire query itself and this class is supposed to be extended by other builders
-
QueryBuilder
- addBindingSource
- addBindingSources
- clearBindingSources
- compile
- getBindings
- popBindingSource
- shiftBindingSource
- shiftBindingSources
- toSQL
• new QueryBuilder(): QueryBuilder
Constructs a new query
• Private bindingSources: ExtendedBindingType[] = []
These are all the bindings that are used by the query builder in order
▸ addBindingSource(value): void
Adds a binding source to the binding source list in order
| Name | Type | Description |
|---|---|---|
value |
ExtendedBindingType |
the binding source to add |
void
▸ addBindingSources(values): void
Adds many binding sources to the bindings sources list
| Name | Type | Description |
|---|---|---|
values |
ExtendedBindingType[] |
the binding sources to add |
void
▸ clearBindingSources(): void
Removes all binding sources
void
▸ compile(): string
Returns the result of the compilation of the query this function needs to be overriden
string
▸ getBindings(): BasicBindingType[]
Provides the bindings for the query in order that should match the compilation
a list of basic bindings
▸ popBindingSource(): ExtendedBindingType
Removes the last added biding source and returns it
▸ shiftBindingSource(value): void
Adds a binding source at the start of the bindings source list
| Name | Type | Description |
|---|---|---|
value |
ExtendedBindingType |
the binding source to add |
void
▸ shiftBindingSources(values): void
Adds many binding sources at the start of the bindings source list
| Name | Type | Description |
|---|---|---|
values |
ExtendedBindingType[] |
the binding sources to add |
void
▸ toSQL(): IQueryBuilderSQLResult
Returns the SQL result for usage in the query builder
IQueryBuilderSQLResult
a sql builder result with the bindings and the query itself