Edgewall Software

Changes between Version 42 and Version 43 of DatabaseBackend


Ignore:
Timestamp:
Jan 23, 2015, 7:42:20 PM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes, added links

Legend:

Unmodified
Added
Removed
Modified
  • DatabaseBackend

    v42 v43  
    1 = Database Backend =
     1= Database Backend
    22
    3 Initially, Trac only supported SQLite for its database backend (see PySqlite).
    4 
    5 Postgresql support has been added as of Trac [milestone:0.9].
    6 
    7 Mysql support will be added for Trac [milestone:0.10]
    8 (see this [http://thread.gmane.org/gmane.comp.version-control.subversion.trac.devel/342/focus=348 status report]).
    9 
    10 More generally, since milestone:0.10, Trac offers an easily extensible layer for
    11 Database support (see [source:trunk/trac/db/api.py trac.db.api]).
    12 
    13 The existing backends have been refactored and integrated in this
    14 layer. There's currently bundled support for:
    15  * '''[http://www.sqlite.org SQLite]''', using '''PySqlite'''
     3Since milestone:0.10, Trac offers an easily extensible layer for Database support, see [source:trunk/trac/db/api.py trac.db.api]. The following backends have been integrated in this layer:
     4 * '''[http://www.sqlite.org SQLite]''', using '''PySqlite''', the default database
    165 * '''[http://www.postgresql.org PostgreSQL]''', using the
    17    '''[http://initd.org/pub/software/psycopg/ psycopg2]''' bindings. [[br]]
     6   '''[http://initd.org/pub/software/psycopg/ psycopg2]''' bindings, support added as of Trac [milestone:0.9].[[br]]
    187   ''Note that ''psycopg1''
    198   is not supported anymore and that [http://pypgsql.sourceforge.net/ pyPgSQL]
    209   also present issues for some users, see #5096).'' [[br]]
    2110   Finally, see #126 for historical notes.
    22  * [http://www.mysql.org MySQL], using MySqlDb (see #986 for historical notes)
     11 * '''[http://www.mysql.org MySQL]''', using MySqlDb, support added for Trac [milestone:0.10]; see [http://thread.gmane.org/gmane.comp.version-control.subversion.trac.devel/342/focus=348 status report] and #986 for historical notes.
    2312
    24 There's some work in progress for the following:
    25  * Ingres (see #6235)
    26  * Oracle (see #1874)
    27  * Microsoft SQL Server (see #329)
     13There's work in progress for the following databases:
     14 * [http://www.actian.com/products/operational-databases/ingres/ Ingres], see #6235.
     15 * [http://www.oracle.com/index.html Oracle], see #1874.
     16 * [http://www.microsoft.com/en-us/server-cloud/products/sql-server/ Microsoft SQL Server], see #329.
    2817
    29 == Backend Specific Installation Instructions ==
     18== Backend Specific Installation Instructions
    3019
    31 === SQLite ===
     20=== SQLite
    3221
    33 Should be installed out-of-the-box, provided you have installed the PySqlite bindings.
     22Installed out-of-the-box, provided you have installed the PySqlite bindings.
    3423
    35 Known issues: see [query:keywords=~sqlite&status=!closed pysqlite-related tickets]
     24Known issues: see [query:keywords=~sqlite&status=!closed pysqlite-related tickets].
    3625
     26=== Postgresql
    3727
    38 === Postgresql ===
    39 
    40  * Have a working copy of Postgresql
    41  * Get the proper database driver for Python (see above)
    42  * Create a database for your Trac environment
     28Prerequisites:
     29 * Have a working copy of Postgresql.
     30 * Get the proper database driver for Python, see above.
     31 * Create a database for your Trac environment.
    4332{{{
    4433% createdb dbname
    4534}}}
    46  * Run trac-admin to create a new Trac environment.  When prompted for a Database connection string, use:
     35 * Run trac-admin to create a new Trac environment. When prompted for a Database connection string, use:
    4736{{{
    4837postgres://user:pass@localhost:5432/dbname?schema=schemaname
    4938}}}
    5039
    51 Notice that the port number might be different in your Postgresql installation, e.g. 5433 (see postgresql.conf).
     40Notice that the port number might be different in your Postgresql installation, eg 5433, see postgresql.conf.
    5241
    5342Alternatively on UNIX, if the database is a local one, you can use UNIX sockets instead of TCP/IP:
     
    5544postgres://user:pass@/dbname?host=/path/to/unix/socket/dir&schema=schemaname
    5645}}}
    57 If you're using user trac without a password to connect through unix sockets to database trac and have only one project (hence no need for different schemas), your connections string would be ''postgres://trac:@/trac''
     46If you are using user Trac without a password to connect through UNIX sockets to database trac and have only one project (hence no need for different schemas), your connections string would be ''postgres://trac:@/trac''
    5847
    5948 * Note: '?host=...' is optional. Check your postgresql.conf' unix_socket_directory option if you have connection problems.
     
    6150See #4546 for more details.
    6251
    63 
    64 
    6552See also #2441, which discusses the process of migration from SQLite to Postgresql.
    6653
    6754For a postgresql recipe tested on CentOS4 (Red Hat -EL4) see [wiki:PostgresqlRecipe].
    6855
    69 Note: Since Trac [milestone:0.10 0.10] the psycopg1 postgresql driver is no longer supported due to lack of unicode support.
     56Note: Since Trac [milestone:0.10 0.10] the psycopg1 postgresql driver is no longer supported due to lack of Unicode support.
    7057
    7158Known issues: see [query:keywords=~postgres&status=!closed postgres-related tickets]
    7259
     60=== MySQL
    7361
    74 === MySQL ===
     62MySQL is supported by Trac since [milestone:0.10], but there are some caveats, documented in more details in the MySqlDb page.
    7563
    76 It is somewhat supported by Trac since [milestone:0.10], but there are some limitations,
    77 documented in more details in the MySqlDb page. Use this only if you don't have other choice, and be warned that there can be many issues, in particular related to the unicode support and the repository cache support. Some users are nevertheless using MySQL successfully, so it ''can'' work for you, provided you carefully read and follow the instructions given in the MySqlDb page.
    78 
    79  * Run trac-admin to create a new Trac environment.  When prompted for a database connection string, use:
     64 * Run trac-admin to create a new Trac environment. When prompted for a database connection string, use:
    8065{{{
    8166mysql://dbuser:dbpass@host:port/dbname
     
    9580* `unix_socket`: Use a Unix socket at the given path to connect
    9681
    97 Known issues: see [query:keywords=~mysql&status=!closed mysql-related tickets]
     82Known issues: see [query:keywords=~mysql&status=!closed mysql-related tickets].
    9883
    99 Users have reported success in [wiki:SqLiteToMySql Conversion from SQLite].
     84Users have reported success in [wiki:SqLiteToMySql converting their database from SQLite to MySQL].
    10085
    101 == Alternative Ideas for Database Independence ==
     86== Alternative Ideas for Database Independence
    10287
    103 === Object-Relational Mapper ===
     88=== Object-Relational Mapper
    10489
    10590An ORM could be used to provide a unified object interface to different RDBMS:
    106  * some people have been talking about using [http://sqlobject.org SQLObject]
    107    to accomplish this goal of database independence.
    108  * [http://modeling.sourceforge.net/ Modeling]
    109    Another, more advanced (and more complex) OR-Mapper.
    110  * [http://www.sqlalchemy.org/ SQLAlchemy] seems to be also quite advanced
     91 * some people have been talking about using [http://sqlobject.org SQLObject] to accomplish this goal of database independence.
     92 * [http://modeling.sourceforge.net/ Modeling], which is another, more advanced OR-Mapper.
     93 * [http://www.sqlalchemy.org/ SQLAlchemy] is also quite advanced.
    11194
    11295Comparisons between both and more info on Python ORMs:
     
    11497 * http://google.com/search?q=SQLObject+modeling
    11598
    116 === Store Tickets and Wiki pages directly in the Subversion repository ===
     99=== Store Tickets and Wiki pages directly in the Subversion repository
    117100
    118 A compelling idea with many advantages. A page advocating this plan is TighterSubversionIntegration. There has also been a discussion on the Trac mailing list. All arguments from this discussion are summarized on the page [wiki:WhySQLite WhySQLite].
     101A compelling idea with many advantages. A page advocating this plan is TighterSubversionIntegration. There has also been a discussion on the Trac mailing list, of which the arguments are summarized on the page [wiki:WhySQLite WhySQLite].
    119102
    120 === Other Alternatives ===
     103=== Other Alternatives
    121104
    122105 * http://wiki.w4py.org/databaseintegration.html