Module: DBI::DBD::SQLite3

Defined in:
lib/dbd/SQLite3.rb

Overview

DBD::SQLite3 - Database Driver for SQLite versions 3.x

Requires DBI and the ‘sqlite3-ruby’ gem to work.

Only things that extend DBI’s results are documented.

Defined Under Namespace

Classes: Database, Driver, Statement

Constant Summary collapse

VERSION =
"1.2.5"
DESCRIPTION =
"SQLite 3.x DBD for DBI"

Class Method Summary collapse

Class Method Details

.driver_nameObject

returns ‘SQLite3’

See DBI::TypeUtil#convert for more information.



61
62
63
# File 'lib/dbd/SQLite3.rb', line 61

def self.driver_name
    "SQLite3"
end

.parse_type(type_name) ⇒ Object

Validates that the SQL has no literal NUL characters. (ASCII 0)

SQLite apparently really hates it when you do that.

It will raise DBI::DatabaseError should it find any.



72
73
74
75
76
# File 'lib/dbd/SQLite3.rb', line 72

def self.parse_type(type_name)
    # FIXME plucked from SQLite driver, this needs to be in DBI proper
    return ['varchar'] unless type_name
    type_name.match(/^([^\(\s]+)\s*(\(\s*(\d+)\s*(,\s*(\d+))?\s*\))?$/)
end