Edgewall Software

Changes between Version 32 and Version 33 of TracDev/DatabaseApi


Ignore:
Timestamp:
Feb 23, 2016, 2:41:02 PM (8 years ago)
Author:
figaro
Comment:

Further cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/DatabaseApi

    v32 v33  
    159159=== Configuration
    160160
    161 For determining which database has to be used, Trac looks at the value of the {{{database}}} configuration option in [wiki:TracIni trac.ini], which should contain a database connection URI. The default value for this option tells Trac to use an SQLite database inside the environment directory:
     161To determine which database has to be used, Trac looks at the value of the {{{database}}} configuration option in [wiki:TracIni trac.ini], which should contain a database connection URI. The default value for this option tells Trac to use an SQLite database inside the environment directory:
    162162
    163163{{{#!ini
     
    200200== Rules for DB API Usage
    201201
    202 Different DB API modules have different ways to pass parameters to the cursors' {{{execute}}} method, and different ways to access query results. To keep the database API as thin as possible, the Trac team has decided to use a relatively common subset in all database code.
     202Different DB API modules have different ways to pass parameters to the cursors' {{{execute}}} method, and different ways to access query results. To keep the database API as thin as possible, Trac uses a relatively common subset in all database code.
    203203
    204204=== Parameter passing
     
    246246== Guidelines for SQL Statements
    247247
    248 As you may know, support for the SQL syntax varies among database systems. At Trac we try to stick to a common subset that is supported by the majority of databases:
     248As you may know, support for the SQL syntax varies among database systems. Trac adheres to a common subset that is supported by the majority of databases:
    249249
    250250 - no native `date` or `time` database types; store date and time information in seconds as `int` fields (before 0.12) or better, in microseconds and `int64` fields (since 0.12, mapped by each `trac.db.IDatabaseConnector` to a suitable database specific type)
    251251 - no triggers
    252  - you may use views if you feel you need them, but so far we didn't feel the need within Trac itself
    253 
    254 For anything not portable (and you really fall quickly in there), you need to use some methods from the connection when building your SQL query (e.g. `db.cast(column, type)`, `db.concat(*params)`, `db.like()`, `db.like_escape()`, `db.quote(param)`, `db.get_last_id(cursor, table, col)`).
     252 - you may use views if you feel you need them, but this not used within Trac core
     253
     254For anything not portable (and you really fall quickly in there), you need to use some methods from the connection when building your SQL query, such as `db.cast(column, type)`, `db.concat(*params)`, `db.like()`, `db.like_escape()`, `db.quote(param)`, `db.get_last_id(cursor, table, col)`.
    255255
    256256For example: