"*OPTIONAL* Return a set of maps containing information about the active tables/views, collections, or equivalent that currently exist in DATABASE.
Each map should contain the key `:name`, which is the string name of the table. For databases that have a concept of schemas,
this map should also include the string name of the table's `:schema`.
Two different implementations are provided in this namespace: `fast-active-tables` (the default), and `post-filtered-active-tables`. You should be fine using
the default, but refer to the documentation for those functions for more details on the differences.")
;; The following apply-* methods define how the SQL Query Processor handles given query clauses. Each method is called when a matching clause is present
;; in QUERY, and should return an appropriately modified version of KORMA-QUERY. Most drivers can use the default implementations for all of these methods,
;; but some may need to override one or more (e.g. SQL Server needs to override the behavior of `apply-limit`, since T-SQL uses `TOP` instead of `LIMIT`).
"*OPTIONAL* Return a set of maps containing information about the active tables/views, collections, or equivalent
that currently exist in DATABASE. Each map should contain the key `:name`, which is the string name of the table.
For databases that have a concept of schemas, this map should also include the string name of the table's
`:schema`.
Two different implementations are provided in this namespace: `fast-active-tables` (the default), and
`post-filtered-active-tables`. You should be fine using the default, but refer to the documentation for those
functions for more details on the differences.")
;; The following apply-* methods define how the SQL Query Processor handles given query clauses. Each method is
;; called when a matching clause is present in QUERY, and should return an appropriately modified version of
;; `HONEYSQL-FORM`. Most drivers can use the default implementations for all of these methods, but some may need to
;; override one or more (e.g. SQL Server needs to override the behavior of `apply-limit`, since T-SQL uses `TOP`
"Given a `Database` DETAILS-MAP, return a JDBC connection spec.")
(current-datetime-fn[this]
"*OPTIONAL*. HoneySQL form that should be used to get the current `DATETIME` (or equivalent). Defaults to `:%now`.")
"*OPTIONAL*. HoneySQL form that should be used to get the current `DATETIME` (or equivalent). Defaults to
`:%now`.")
(date[this,^Keywordunit,field-or-value]
"Return a HoneySQL form for truncating a date or timestamp field or value to a given resolution, or extracting a date component.")
"Return a HoneySQL form for truncating a date or timestamp field or value to a given resolution, or extracting a
date component.")
(excluded-schemas^java.util.Set[this]
"*OPTIONAL*. Set of string names of schemas to skip syncing tables from.")
(field->identifier[this,^FieldInstancefield]
"*OPTIONAL*. Return a HoneySQL form that should be used as the identifier for FIELD.
The default implementation returns a keyword generated by from the components returned by `field/qualified-name-components`.
Other drivers like BigQuery need to do additional qualification, e.g. the dataset name as well.
(At the time of this writing, this is only used by the SQL parameters implementation; in the future it will probably be used in more places as well.)")
The default implementation returns a keyword generated by from the components returned by
`field/qualified-name-components`. Other drivers like BigQuery need to do additional qualification, e.g. the
dataset name as well. (At the time of this writing, this is only used by the SQL parameters implementation; in
the future it will probably be used in more places as well.)")
(field->alias^String[this,^Fieldfield]
"*OPTIONAL*. Return the alias that should be used to for FIELD, i.e. in an `AS` clause. The default implementation calls `name`, which
returns the *unqualified* name of `Field`.
"*OPTIONAL*. Return the alias that should be used to for FIELD, i.e. in an `AS` clause. The default implementation
calls `name`, which returns the *unqualified* name of `Field`.
Return `nil` to prevent FIELD from being aliased.")
(prepare-sql-param[thisobj]
"*OPTIONAL*. Do any neccesary type conversions, etc. to an object being passed as a prepared statment argument in a parameterized raw SQL query.
For example, a raw SQL query with a date param, `x`, e.g. `WHERE date > {{x}}`, is converted to SQL like `WHERE date > ?`, and the value of
`x` is passed as a `java.sql.Timestamp`. Some databases, notably SQLite, don't work with `Timestamps`, and dates must be passed as string literals
instead; the SQLite driver overrides this method to convert dates as needed.
"*OPTIONAL*. Do any neccesary type conversions, etc. to an object being passed as a prepared statment argument in
a parameterized raw SQL query. For example, a raw SQL query with a date param, `x`, e.g. `WHERE date > {{x}}`, is
converted to SQL like `WHERE date > ?`, and the value of `x` is passed as a `java.sql.Timestamp`. Some databases,
notably SQLite, don't work with `Timestamps`, and dates must be passed as string literals instead; the SQLite
driver overrides this method to convert dates as needed.
The default implementation is `identity`.
NOTE - This method is only used for parameters in raw SQL queries. It's not needed for MBQL queries because other functions like `prepare-value` are
used for similar purposes; at some point in the future, we might be able to combine them into a single method used in both places.")
NOTE - This method is only used for parameters in raw SQL queries. It's not needed for MBQL queries because other
functions like `prepare-value` are used for similar purposes; at some point in the future, we might be able to
combine them into a single method used in both places.")
(prepare-value[this,^Valuevalue]
"*OPTIONAL*. Prepare a value (e.g. a `String` or `Integer`) that will be used in a HoneySQL form. By default, this returns VALUE's `:value` as-is, which
is eventually passed as a parameter in a prepared statement. Drivers such as BigQuery that don't support prepared statements can skip this
behavior by returning a HoneySQL `raw` form instead, or other drivers can perform custom type conversion as appropriate.")
"*OPTIONAL*. Prepare a value (e.g. a `String` or `Integer`) that will be used in a HoneySQL form. By default, this
returns VALUE's `:value` as-is, which is eventually passed as a parameter in a prepared statement. Drivers such
as BigQuery that don't support prepared statements can skip this behavior by returning a HoneySQL `raw` form
instead, or other drivers can perform custom type conversion as appropriate.")
(quote-style^clojure.lang.Keyword[this]
"*OPTIONAL*. Return the quoting style that should be used by [HoneySQL](https://github.com/jkk/honeysql) when building a SQL statement.
Defaults to `:ansi`, but other valid options are `:mysql`, `:sqlserver`, `:oracle`, and `:h2` (added in `metabase.util.honeysql-extensions`;
like `:ansi`, but uppercases the result).
"*OPTIONAL*. Return the quoting style that should be used by [HoneySQL](https://github.com/jkk/honeysql) when
building a SQL statement. Defaults to `:ansi`, but other valid options are `:mysql`, `:sqlserver`, `:oracle`, and
`:h2` (added in `metabase.util.honeysql-extensions`; like `:ansi`, but uppercases the result).
(hsql/format ... :quoting (quote-style driver))")
(set-timezone-sql^String[this]
"*OPTIONAL*. This should be a format string containing a SQL statement to be used to set the timezone for the current transaction.
The `%s` will be replaced with a string literal for a timezone, e.g. `US/Pacific`.
"*OPTIONAL*. This should be a format string containing a SQL statement to be used to set the timezone for the
current transaction. The `%s` will be replaced with a string literal for a timezone, e.g. `US/Pacific.`
\"SET @@session.timezone = %s;\"")
(stddev-fn^clojure.lang.Keyword[this]
"*OPTIONAL*. Keyword name of the SQL function that should be used to do a standard deviation aggregation. Defaults to `:STDDEV`.")
"*OPTIONAL*. Keyword name of the SQL function that should be used to do a standard deviation aggregation. Defaults