Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1813 (closed task: migrated)

Opened 11 years ago

Last modified 8 years ago

Refactor database configuration

Reported by: Chris Arndt Owned by: chrisz
Priority: normal Milestone: 1.1.x bugfix
Component: TurboGears Version: 1.1 HEAD
Severity: normal Keywords: migrate


  1. Replace backslashes (windows paths) in current_dir_uri (in config.py)
  1. New function "get_dburi" or "get_db_config" (in database.py) that
    • Chooses the correct config setting to use (sqlobject.* vs sqlalchemy.*)
    • Converts : into | for SQLObject
    • Converts | into : for SQLAlchemy
    • Handles 'notrans_' (but see "open questions" below)
  1. Use 'get_dburi' in
  1. Test multiple dburis for SQLAlchemy and write unit tests for this feature. Possibly change the way multiple database connections are handled completely, since current support does not support different ORMs.
  1. Open questions:
    • Where to handle "no_trans" best?
    • Support "notrans_" for SQLAlchemy too?
    • Continue to support dburis of the form <packagename>.dburi? If yes, how to distinguish between SQLObject and SQLAlchemy?
    • What should get_dburi return? A string or a dict?

Change History

comment:1 Changed 11 years ago by chrisz

Some comments:

  • Point 1 can be realized with the urllib.pathname2url() function.
  • I think dburis should not be associated with package names, but just with names. The PackageHub class should become NamedHub. The reference to packages was confusing. Note that "packagename" here did not refer to the ORM package "sqlobject" or "sqlalchemy", but was supposed to refer to a subpackage of the app using a different database connection.
  • We should decide whether the setting is called [<name>].dburi or [<name>].sql{alchemy|object}.dburi. Currently, the default dburi has the sql{alchemy|object} distinguisher, but the named dburis don't.
  • See also  thread in tg-trunk.

comment:2 Changed 11 years ago by faide

  • Milestone changed from 1.5 to 1.1

comment:3 Changed 10 years ago by Chris Arndt

Also, see #2048 for a bug related to point 4.

comment:4 Changed 10 years ago by Chris Arndt

  • Status changed from new to assigned
  • Owner changed from anonymous to Chris Arndt

comment:5 Changed 10 years ago by Chris Arndt

  • Milestone changed from 1.1 to 1.1.x bugfix

Moving to 1.1.x bugfix release in preparation for 1.1rc1 release.

comment:6 Changed 8 years ago by Chris Arndt

  • Owner changed from Chris Arndt to chrisz
  • Status changed from assigned to new
  • Keywords migrate added

I think this ticket should be migrated to the new tracker. All the improvements it suggests are still mot implemented and desireable.

comment:7 Changed 8 years ago by chrisz

  • Status changed from new to closed
  • Resolution set to migrated
Note: See TracTickets for help on using tickets.