Opened 10 years ago
Last modified 9 years ago
#11985 new task
Create a [database] section in trac.ini
Reported by: | Ryan J Ollos | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | next-major-releases |
Component: | database backend | Version: | |
Severity: | normal | Keywords: | options |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Continuing with the theme of better categorizing the options in trac.ini (#11776, #11703, #11849, #11956, and less-so #11856, #11976), I'm considering the following:
[trac]
backup_dir
→[database]
backup_dir
[trac]
database
→[database]
connection_uri
[trac]
timeout
→[database]
connection_timeout
[trac]
debug_sql
→[database]
debug_sql
[trac]
pg_dump_path
→[postgresql]
dump_path
[trac]
mysqldump_path
→[mysql]
dump_path
I'm considering putting the latter two in the [database]
section, however note that an [sqlite] section already exists.
Careful review of the [trac]
section may lead to some other options for re-categorization. Given the number of Option changes that are already made for milestone:1.2, it seems best to make these changes before that release.
Attachments (0)
Change History (4)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:3 by , 10 years ago
That changes would lead consistency and elegancy. However, many code in Trac core and plugins directly call self.config.get('trac', 'database')
. I think we should leave only [trac] database
option without changes.
IMO, I'd like to use DatabaseManager(self.env).connection_uri
rather than. However, the reviewer has suggested self.config.get('trac', 'database')
.
$ git grep "[\"']trac[\"'], *[\"']database[\"']" trac/admin/console.py: ('trac', 'database', db_str), trac/db/api.py: connection_uri = Option('trac', 'database', 'sqlite:db/trac.db', trac/db/api.py: db_str = self.config.get('trac', 'database') trac/db/mysql_backend.py: db_url = self.env.config.get('trac', 'database') trac/db/postgres_backend.py: db_url = self.env.config.get('trac', 'database') trac/db/sqlite_backend.py: db_str = self.config.get('trac', 'database') trac/env.py: db_str = self.env.config.get('trac', 'database') trac/test.py: self.config.set('trac', 'database', self.dburi) trac/upgrades/db16.py: if env.config.get('trac', 'database').startswith('postgres'): $ git --git-dir ~/src/trac-hacks.org/.git grep "[\"']trac[\"'], *[\"']database[\"']" | wc -l 81
comment:4 by , 10 years ago
Milestone: | next-dev-1.1.x → next-major-releases |
---|
Replying to rjollos:
Considering the use-case of a deployment script that installs a Trac instance and sets configuration options using TracAdmin, the changes in tickets such as #11776 could be considered API changes. I'm not sure it's worth retaining the old option names and having some deprecation mechanism for renamed options, however considering that these changes may be viewed as API changes would provide more motivation for completing further changes before Trac 1.2 so that end-users only have to deal with a large number of changes in a single major release.