forked from Pistos/ruby-dbi
-
Notifications
You must be signed in to change notification settings - Fork 1
DBI Topic Areas
pilcrow edited this page Sep 13, 2010
·
6 revisions
- Clarify specification: standardize mapping of SQL92 types to Ruby types
- Should
dbh.tables()
and.columns()
be modified to accept catalog and schema specifiers (ala perl-DBI?) [rf-1082, rf-3028] - Same question for an eventual
quote_identifier
method
DBI naming consistency issues
CamelCasing
vs. lower_with_underscores
, handle['attribute']
vs. handle.accessor
- attribute access and naming style:
dbh['AutoCommit']
, butdbh.raise_error
- driver prefixes inconsistent:
mysql_col_info['mysql_type']
, butpg_col_info['array_of_type']
pilcrow: should be @pg_ci[‘pg_array_of_type’]
- Clarify specification of DBI::DatabaseError subfields [rf-26766, rf-27227]
- Improve consistency of DBDs’
.state
and.err
setting - Re-assess DBI::DatabaseError subclasses
pilcrow: ProgrammingError is highly suspect (IMHO), as it diagnoses the intent and competence of the coder. Some DDL, for instance DROPing a table, might be used by two db-aware processes to communicate (implied) state. After all, when I code systems apps,ENOENT
isn’t necessarily bad nor unexpected
Most items fetched from SQL should be considered tainted, incl. dbh.database_name
, which can be changed programmatically, by client library action, etc., and dbh.func(:some_server_parameter)
. Perhaps dbh['AutoTaint'] = true
is passed down to DBI::Row
so that individual elements are tainted upon fetch.
- Named bind (in) parameter support [rf-3865]
- Multiple result set support [rf-23896, rf-24126]
pilcrow: what would this look like? - Statement preparation behavioral control [rf-21848, see also various perl DBDs]
JDBC-like auto-preparation after “too many plain executions”? Explicit control? Per-DBD?
pilcrow: should the DBI make an attempt at extracting the normalized SQL “action” (e.g., :select, :values, :insert, :update, :drop) and no. of params, for a DBD to determine if the statement can be profitably prepared at all? -
DBI::StatementHandle support for same-named columns
pilcrow: pg happily returns same named columns. caveat coder, and discriminate fields by positional index if you run into this