Menu

Trac Commit Log


Commit Date  
[r10187] by cboos

#9536: convert the contrib and sample-plugins to use context managers for database access.

2010-10-05 21:45:48 Tree
[r10186] by cboos

fixup merge mistake in r10185

2010-10-05 21:45:14 Tree
[r10185] by cboos

#9536: convert ticket module to use context managers for database access.

2010-10-05 21:43:27 Tree
[r10184] by cboos

#9536: convert versioncontrol module to use context managers for database access.

2010-10-05 21:43:01 Tree
[r10183] by cboos

#9536: convert wiki module to use context managers for database access.

2010-10-05 21:42:37 Tree
[r10182] by cboos

#9536: convert the base system and smaller modules to use context managers for database access.

2010-10-05 21:37:58 Tree
[r10181] by cboos

#9536: convert web layer to use context managers for database access.

2010-10-05 21:36:31 Tree
[r10180] by cboos

#9536: rework EnvironmentStub, use context managers and support sqlite file based backend.
- convert admin tests and web tests
- no need for the mysql specific test which was run for any backend

2010-10-05 21:35:46 Tree
[r10179] by cboos

db: introduce context managers for working with a database connection.

SQL transactions can be executed this way:
{{{#!python
from trac.env import Environment
def myFunc():
env = Environment('/path/to/projenv')
with env.db_transaction as db:
cursor = db.cursor()
# Execute some SQL statements

}}}
When the `with` statement is exited normally, the transaction gets committed. Note that `myFunc()` can itself be called in such a `db_transaction` context. In that case, no commit will happen in myFunc, it's the outermost context which will take care of committing the transaction. If an exception gets raised, the `db_transaction` context manager will roll back the transaction.

Another context manager for performing "read-only" queries can be obtained via `env.db_query`. That one doesn't `commit` or `rollback`, but returns the connection to the pool when exiting the context, making that connection available to other threads as soon as possible.

See TracDev/DatabaseApi#Trac0.13API for more details.

Part of #9536.

2010-10-05 21:28:06 Tree
[r10178] by rblank

0.13dev: Added two select boxes to the "Basic Settings" admin panel, for the default timezone and default language.

Excellent initial patch by Ryan J Ollos, thanks! Closes #9581.

2010-10-05 20:06:53 Tree
Older >
MongoDB Logo MongoDB