api-docs / org.ktorm.database / SqlDialect
SqlDialect
interface SqlDialect
(source code)Representation of a SQL dialect.
It’s known that there is a uniform standard for SQL language, but beyond the standard, many databases still have
their special features. The interface provides an extension mechanism for Ktorm and its extension modules to support
those dialect-specific SQL features.
Implementations of this interface are recommended to be published as separated modules independent of ktorm-core.
To enable a dialect, applications should add the dialect module to the classpath first, then configure the dialect
parameter to the dialect implementation while creating database instances via Database.connect functions.
Since version 2.4, Ktorm’s dialect modules start following the convention of JDK ServiceLoader SPI, so we don’t
need to specify the dialect
parameter explicitly anymore while creating Database instances. Ktorm auto-detects
one for us from the classpath. We just need to insure the dialect module exists in the dependencies.
Functions
Name | Summary |
---|---|
open fun createExpressionVisitor( Create a default visitor instance for this dialect using the specific interceptor. | |
open fun createSqlFormatter( Create a SqlFormatter instance, formatting SQL expressions as strings with their execution arguments. | |
open fun executeUpdateAndRetrieveKeys( Execute the given SQL string (typically an insert statement), then return the effected row count along with |
Extension Functions
Name | Summary |
---|---|
infix fun <T : Any> T.eq( Equal operator, translated to | |
infix fun <T : Any> T.neq( Not-equal operator, translated to | |
infix fun <T : Any> T.notEq( Not-equal operator, translated to |
Inheritors
Name | Summary |
---|---|
open class MySqlDialect : SqlDialect SqlDialect implementation for MySQL database. | |
open class OracleDialect : SqlDialect SqlDialect implementation for Oracle database. | |
open class PostgreSqlDialect : SqlDialect SqlDialect implementation for PostgreSQL database. | |
open class SQLiteDialect : SqlDialect SqlDialect implementation for SQLite database. | |
open class SqlServerDialect : SqlDialect SqlDialect implementation for Microsoft SqlServer database. |