| 152 | ==== `Environment.get_db_cnx` has been removed #get_db_cnx |
| 153 | |
| 154 | Following the [../0.12#get_db_cnx deprecation] made in 0.12, the method `Environment.get_db_cnx` has been removed. |
| 155 | |
| 156 | One should now only use the //context managers// for retrieving a database Connection |
| 157 | in read or write mode. |
| 158 | - a **read-only** Connection can be used to form queries: |
| 159 | {{{#!python |
| 160 | with env.db_query as db: |
| 161 | ... |
| 162 | }}} |
| 163 | a `db` instance obtained the above way should only be used for executing //SELECT// |
| 164 | queries |
| 165 | - a **writable** Connection can be used to modify the database content in a transaction: |
| 166 | {{{#!python |
| 167 | with env.db_transaction as db: |
| 168 | ... |
| 169 | }}} |
| 170 | a `db` instance obtained the above way can be used to execute //INSERT/UPDATE/DELETE// |
| 171 | queries; they will be committed when the last such automatic transaction |
| 172 | in the control flow completes successfully. See DatabaseApi for the full details. |
| 173 | |
| 174 | `Environment.get_read_db` and the decorators `@with_transaction(env)` and `env.with_transaction()` have been [../1.0#with_transaction deprecated] since Trac 1.0 and will be removed in Trac 1.3.1. |
| 175 | |
| 176 | |
| 177 | ==== `db` parameters removed from function and method signatures |
| 178 | |
| 179 | With the introduction of `@with_transaction(env)` decorators in 0.12 and continuing with the introduction of the database connection context managers in 1.0, the `db` parameters passed as function and method arguments became [../0.12#Othernews deprecated]. |
| 180 | |
| 181 | The `db` parameters have been removed from nearly all function and method signatures. The `db` arguments are still present on methods of `IEnvironmentParticipant` implementations, but are deprecated and should no longer be used. They will be removed in 1.3.1. |
| 182 | |
| 183 | |
| 184 | ==== `ConnectionBase` class |
| 185 | |
| 186 | The `ConnectionBase` class defines an abstract interface that database backends must adhere to when implementing a `Connection` class. |
| 187 | |
| 188 | |
| 189 | === Template and CSS changes |
| 190 | |
| 191 | `tt` tags are not support in HTML5 and have been replaced with `code` tags in Trac (#11094). The styling of `tt` and `code` tags is the same in Trac , but `code` tags should be used since the styling for `tt` tags will be removed in a future version of Trac. |
| 192 | |
| 193 | The `about.css` stylesheet has been removed and the rules contained in that stylesheet have been moved to `trac.css`. The table of environment information on the //Error// and //About// pages have been extracted to a new template `environment_info.html` and the markup and associated rules in the stylesheet have been significantly changed. |
| 194 | |
| 195 | //Many more changes to be added, depending on how details we want to get. TracUpgrade#CustomizedTemplates claims that changes to `id`s and CSS `class`es will be documented in ApiChanges.// |
| 196 | |
| 197 | |