Package dev.warrengates.bettermetadata

Types

Link copied to clipboard
class Attribute(rs: ResultSet)

Wrapper for results of getAttributes method and represents an attribute of a UserDefinedType.

Link copied to clipboard
enum AttributeNullable : Enum<AttributeNullable> , IntegerEnum

Indicates whether NULL is allowed

Link copied to clipboard
enum BestRowColumnType : Enum<BestRowColumnType> , IntegerEnum

Indicates whether best row column is a pseudo column like an Oracle ROWID

Link copied to clipboard
class BestRowIdentifier(rs: ResultSet)

Wrapper for results of getBestRowIdentifier method and represents the optimal set of columns that uniquely identify a Table's row

Link copied to clipboard
enum BestRowIdentifierScope : Enum<BestRowIdentifierScope> , IntegerEnum

Best row identifier scope

Link copied to clipboard
class ClientInfoProperties(rs: ResultSet)

Wrapper for results of getClientInfoProperties method and represents a list of the client info properties supported by the current driver

Link copied to clipboard
class Column(metadata: DatabaseMetaData, rs: ResultSet)

Wrapper for results of getColumns method and represents a Table column

Link copied to clipboard
enum ColumnNullable : Enum<ColumnNullable> , IntegerEnum

Column nullable

Link copied to clipboard
class ColumnPrivilege(rs: ResultSet)

Wrapper for results of getColumnPrivileges method. Used from Column.getColumnPrivileges

Link copied to clipboard
class Database @JvmOverloads constructor(    metadata: DatabaseMetaData,     val defaultCatalog: String? = null,     val defaultSchema: String? = null)

Provides a wrapper around DatabaseMetaData.

Link copied to clipboard
enum ForeignKeyDeleteRule : Enum<ForeignKeyDeleteRule> , IntegerEnum

Foreign key delete rule

Link copied to clipboard

Foreign key initial deferrability

Link copied to clipboard
enum ForeignKeyUpdateRule : Enum<ForeignKeyUpdateRule> , IntegerEnum

Foreign key update rule

Link copied to clipboard
class Function(metadata: DatabaseMetaData, rs: ResultSet)

Wrapper for results of getFunctions method and represents user and system functions

Link copied to clipboard
class FunctionColumn(rs: ResultSet)

Wrapper for results of getFunctionColumns method and represents a column of Function

Link copied to clipboard
enum FunctionColumnNullable : Enum<FunctionColumnNullable> , IntegerEnum

Function column nullable

Link copied to clipboard
enum FunctionColumnType : Enum<FunctionColumnType> , IntegerEnum

Function column type

Link copied to clipboard
enum FunctionReturnType : Enum<FunctionReturnType> , IntegerEnum

Function return type

Link copied to clipboard
class Index(rs: ResultSet)

Wrapper for the results of the getIndexInfo method and represents a Table's indices and statistics. Returned from Table.getIndexes

Link copied to clipboard
enum IndexSort : Enum<IndexSort> , StringEnum

Index sort

Link copied to clipboard
enum IndexType : Enum<IndexType> , IntegerEnum

Index type

Link copied to clipboard
interface IntegerEnum

Integer enum, convenience interface for converting integer values to enums

Link copied to clipboard
enum IsAutoIncrement : Enum<IsAutoIncrement> , StringEnum

Is auto increment, values taken from returned strings

Link copied to clipboard
enum IsGeneratedColumn : Enum<IsGeneratedColumn> , StringEnum

Is generated column, values taken from returned strings

Link copied to clipboard
enum IsGrantable : Enum<IsGrantable> , StringEnum

Is grantable, values taken from returned strings

Link copied to clipboard
enum IsNullable : Enum<IsNullable> , StringEnum

Is nullable, values taken from returned strings

Link copied to clipboard
class Key(    val primaryKeyName: String?,     val foreignKeyName: String?,     val updateRule: ForeignKeyUpdateRule,     val deleteRule: ForeignKeyDeleteRule,     val deferrability: ForeignKeyInitialDeferrability,     val keyColumns: List<KeyColumn>)

Key

Link copied to clipboard
class KeyColumn(    val primaryKeyColumn: Column,     val foreignKeyColumn: Column,     val sequenceNumber: Int)

Key column

Link copied to clipboard
typealias MetadataInt = Int?

Various integer columns (such as DECIMAL_DIGTS) returned from DatabaseMetaData functions indicate that null is returned when the value is not applicable. Since ResultSet.getInt returns 0 for null values, you'll never actually get null returned. If you'd prefer to have nulls returned when null exists in the ResultSet, use the below code. It uses a nullable Int (kotlin) or Integer (java) and sets it to null appropriately.

If you'd rather get 0 values instead of nulls, comment out the code immediately below and use the 'Non-nullable int' code at the bottom

Note that at this point not all possible values are using this type alias

Link copied to clipboard
class PrimaryKey(val name: String?, val primaryKeyColumns: List<PrimaryKeyColumn>)

Wrapper for results of getPrimaryKeys. It has been refactored to provide of Column object rather than the flattened view provided by the getPrimaryKeys method.

Link copied to clipboard
class PrimaryKeyColumn(val column: Column, val sequenceNumber: Int)

Holds a Column and its sequence number for use in PrimaryKey

Link copied to clipboard
class Procedure(metadata: DatabaseMetaData, rs: ResultSet)

Wrapper for results of getProcedures method and represents a stored procedure

Link copied to clipboard
class ProcedureColumn(rs: ResultSet)

Wrapper for results of getProcedureColumns

Link copied to clipboard

Procedure column nullable

Link copied to clipboard
enum ProcedureColumnType : Enum<ProcedureColumnType> , IntegerEnum

Procedure column type

Link copied to clipboard
enum ProcedureReturnType : Enum<ProcedureReturnType> , IntegerEnum

Procedure return type

Link copied to clipboard
class PseudoColumn(rs: ResultSet)

Wrapper for results of getPseudoColumns

Link copied to clipboard
enum ResultSetConcurrency : Enum<ResultSetConcurrency> , IntegerEnum

Result set concurrency

Link copied to clipboard
enum ResultSetHoldability : Enum<ResultSetHoldability> , IntegerEnum

Result set holdability

Link copied to clipboard
enum ResultSetType : Enum<ResultSetType> , IntegerEnum

Result set type

Link copied to clipboard
class Schema(rs: ResultSet)

Wrapper for results of getSchemas

Link copied to clipboard
enum SQLStateType : Enum<SQLStateType> , IntegerEnum

SQL state type

Link copied to clipboard
interface StringEnum

String enum, convenience interface for converting string values to enums

Link copied to clipboard
class SuperType(rs: ResultSet)

Wrapper for results of getSuperTypes

Link copied to clipboard
class Table(metadata: DatabaseMetaData, rs: ResultSet)

Wrapper for the results of getTables

Link copied to clipboard
class TablePrivilege(rs: ResultSet)

Wrapper for results of getTablePrivileges

Link copied to clipboard
enum TransactionIsolation : Enum<TransactionIsolation> , IntegerEnum

Transaction isolation

Link copied to clipboard
class TypeInfo(rs: ResultSet)

Wrapper for results of getTypeInfo

Link copied to clipboard
enum TypeNullable : Enum<TypeNullable> , IntegerEnum

Type nullable

Link copied to clipboard
enum TypeSearchable : Enum<TypeSearchable> , IntegerEnum

Type searchable

Link copied to clipboard
class UserDefinedType(metaData: DatabaseMetaData, rs: ResultSet)

Wrapper for results of getUDTs

Link copied to clipboard
class VersionColumn(rs: ResultSet)

Wrapper for results of getVersionColumns

Link copied to clipboard
enum VersionColumnType : Enum<VersionColumnType> , IntegerEnum

Version column type

Functions

Link copied to clipboard
inline fun <T : Enum<T>, IntegerEnum> valueOf(value: Int): T

Gets enum of type T where the enums' value matches value. The enum must implement IntegerEnum

inline fun <T : Enum<T>, StringEnum> valueOf(value: String): T

Gets enum of type T where the enums' value matches value. The enum must implement StringEnum