ddbc.core

DDBC - D DataBase Connector - abstraction layer for RDBMS access, with interface similar to JDBC.

Source file ddbc/core.d.

DDBC library attempts to provide implementation independent interface to different databases.

Set of supported RDBMSs can be extended by writing Drivers for particular DBs. Currently it only includes MySQL Driver which uses patched version of MYSQLN (native D implementation of MySQL connector, written by Steve Teale)

JDBC documentation can be found here: http://docs.oracle.com/javase/1.5.0/docs/api/java/sql/package-summary.html

Limitations of current version: readonly unidirectional resultset, completely fetched into memory.

Its primary objects are:

  • Driver:
    • Implements interface to particular RDBMS, used to create connections
  • Connection:
    • Connection to the server, and querying and setting of server parameters.
  • Statement: Handling of general SQL requests/queries/commands, with principal methods:
    • executeUpdate() - run query which doesn't return result set.
    • executeQuery() - execute query which returns ResultSet interface to access rows of result.
  • PreparedStatement: Handling of general SQL requests/queries/commands which having additional parameters, with principal methods:
    • executeUpdate() - run query which doesn't return result set.
    • executeQuery() - execute query which returns ResultSet interface to access rows of result.
    • setXXX() - setter methods to bind parameters.
  • ResultSet:
    • Get result of query row by row, accessing individual fields.

You can find usage examples in unittest{} sections.

Members

Classes

SQLException
class SQLException
Undocumented in source.
SQLWarning
class SQLWarning
Undocumented in source.

Enums

SqlType
enum SqlType

JDBC java.sql.Types from http://docs.oracle.com/javase/6/docs/api/java/sql/Types.html

Functions

makeDDBCUrl
string makeDDBCUrl(string driverName, string host, int port, string dbName, string[string] params)

Helper function to make url in form driverName://host:port/dbname?param1=value1,param2=value2

Interfaces

Connection
interface Connection
Undocumented in source.
DataSetReader
interface DataSetReader
Undocumented in source.
DataSetWriter
interface DataSetWriter
Undocumented in source.
DataSource
interface DataSource
Undocumented in source.
Driver
interface Driver
Undocumented in source.
ParameterMetaData
interface ParameterMetaData
Undocumented in source.
PreparedStatement
interface PreparedStatement

An object that represents a precompiled SQL statement.

ResultSet
interface ResultSet
Undocumented in source.
ResultSetMetaData
interface ResultSetMetaData
Undocumented in source.
Statement
interface Statement
Undocumented in source.

Meta

Authors

Vadim Lopatin