Package-level declarations

Types

Link copied to clipboard
abstract class AdvancedDbType(dbTypeInJdbcUrl: String) : DbType

Alternative version of DbType that allows you to customize type mapping by initializing a JdbcToDataFrameConverter instance for each JDBC type.

Link copied to clipboard
fun interface DbColumnBuilder<in D, out P>
Link copied to clipboard
fun interface DbResultSetReader<out J>
Link copied to clipboard
abstract class DbType(val dbTypeInJdbcUrl: String)

The DbType class represents a database type used for reading a dataframe from the database.

Link copied to clipboard
fun interface DbValuePreprocessor<in J, out D>

This preprocessor can be created for types where you want to convert the values coming from ResultSet.getObject to a different type more suitable to be put in a DataColumn

Link copied to clipboard

Represents the DuckDB database type.

Link copied to clipboard
open class H2(val mode: H2.Mode = Mode.Regular) : DbType

Represents the H2 database type.

Link copied to clipboard
class JdbcToDataFrameConverter<J, D, P>(val expectedJdbcType: KType, val resultSetReader: DbResultSetReader<J>?, val preprocessedValueType: KType, val valuePreprocessor: DbValuePreprocessor<J, D>?, val targetSchema: ColumnSchema?, val columnBuilder: DbColumnBuilder<D, P>?)

Represents all type information that can be retrieved from an SQL column. This can be extended for your specific DbType if you need extra information.

Link copied to clipboard
object MariaDb : DbType

Represents the MariaDb database type.

Link copied to clipboard
object MsSql : DbType

Represents the MSSQL database type.

Link copied to clipboard
object MySql : DbType

Represents the MySql database type.

Link copied to clipboard

Represents the PostgreSql database type.

Link copied to clipboard
class Sqlite(val customTypesMap: Map<String, SqliteCustomTypeConverter<*, *>> = emptyMap(), val customColumnsMap: Map<String, SqliteCustomTypeConverter<*, *>> = emptyMap()) : AdvancedDbType

Represents the Sqlite database type.

Link copied to clipboard

DSL builder collected by Sqlite.withCustomConverters. Register converters via forType (matches by declared SQL type name) or forColumn (matches by column name; takes precedence over forType).

Link copied to clipboard
data class SqliteCustomTypeConverter<T, R>(val expectedType: KType, val resultingType: KType, val convert: (rawValue: T) -> R)

A user-provided converter from an SQLite declared column type name to the DataFrame column type and a lambda that converts each stored value.

Link copied to clipboard
class TableColumnMetadata(val name: String, val sqlTypeName: String, val jdbcType: Int, val size: Int, val javaClassName: String, val isNullable: Boolean = false)

Represents a column in a database table to keep all required meta-information.

Link copied to clipboard
class TableMetadata(val name: String, val schemaName: String?, val catalogue: String?)

Represents a table metadata to store information about a database table, including its name, schema name, and catalogue name.

Properties

Link copied to clipboard

true for a multi-bit BIT(M) column, M > 1, in MySQL and MariaDB.

Link copied to clipboard
internal const val UNNAMED_COLUMN_PREFIX: String

Functions

Link copied to clipboard
Link copied to clipboard

Retrieves the driver class name from the given JDBC URL.

Link copied to clipboard

Extracts the database type from the given connection. For H2, fetches the actual MODE from the active connection settings. For other databases, extracts type from URL.

Link copied to clipboard

Extracts the database type from the given JDBC URL.

Link copied to clipboard
inline fun <reified J> jdbcToDfConverterFor(isNullable: Boolean = typeOf<J>().isMarkedNullable): JdbcToDataFrameConverter<J?, J?, J?>
fun <J> jdbcToDfConverterFor(jdbcSourceType: KType): JdbcToDataFrameConverter<J?, J?, J?>
Link copied to clipboard
fun <J, D, P> JdbcToDataFrameConverter<J, D, *>.withColumnBuilder(targetSchema: ColumnSchema?, canIntroduceNulls: Boolean = false, columnBuilder: DbColumnBuilder<D, P>?): JdbcToDataFrameConverter<J, D, P>
Link copied to clipboard
inline fun <J, reified D> JdbcToDataFrameConverter<J, *, *>.withPreprocessor(canIntroduceNulls: Boolean = false, valuePreprocessor: DbValuePreprocessor<J, D>?): JdbcToDataFrameConverter<J, D, D>
fun <J, D> JdbcToDataFrameConverter<J, *, *>.withPreprocessor(preprocessedValueType: KType, canIntroduceNulls: Boolean = false, valuePreprocessor: DbValuePreprocessor<J, D>?): JdbcToDataFrameConverter<J, D, D>
Link copied to clipboard
Link copied to clipboard