Commit Graph
225 Commits
Author SHA1 Message Date
Cédric Krier 1e0d860fe3 Use simple connection to list databases
When we instantiate a Database for each database to test, the threaded
connection pool keep one connection opens which could consume all the available
connections even if the databases are not really used.

issue5368
review16091002
2016-03-16 22:12:22 +01:00
Cédric Krier 4a4a62dbe1 Add missing Database.connect in list with sqlite
The test method requires the database instance to be connected.

issue5407
review24941002
2016-03-16 13:06:37 +01:00
Nicolas Évrard 2fef479575 Follow PEP-0249 for Transaction and backends
issue4949
review19781002
2016-03-03 21:51:57 +01:00
Cédric Krier 3e13f3d004 Fix SQLite greatest and least for unorderable None
In Python3, None can not be ordered because it doesn't have a natural order.
So we implement the same behaviour for SQLite than PostgreSQL which ignore NULL.

issue5358
review20821002
2016-03-01 21:46:14 +01:00
Cédric Krier 68eca37c72 Add _update_definitions after column_rename
issue5325
review16001002
2016-02-15 10:07:18 +01:00
Cédric Krier 41f4702273 Use warnings instead of logging for missing SQLite TableHandler features
and capture warnings into logging.
This allow to not be flooded by the same kind of warnings when running tests.

issue5316
review17821002
2016-02-09 18:42:59 +01:00
Cédric Krier 29129855ec Add support for Python 3
issue3211
review7311002
2016-02-07 16:46:16 +01:00
Nicolas Évrard d0c5d9692a Remove buggy split introduced in changeset 5eb1afcd5fd6 2016-01-18 22:34:04 +01:00
Nicolas Évrard 88f1bce6d4 Strip and unquote double-quote from Postgresql schema in search_path
issue5248
review16931002
2016-01-18 19:09:48 +01:00
Sharoon Thomas 89de660c52 Move webdav into a separate module
issue4703
review7101002
2016-01-16 19:20:30 +01:00
Cédric Krier 109d0ef64f Manage PostgreSQL schema
Replace usage of pg_catalog tables by information_schema to take care of user
access.
Ensure to fetch the columns information from the right schema.
Prevent to update default column values if it did not change.
Comment table and column only if the current user is the owner.

issue4924
review24291002
2015-09-04 11:16:09 +02:00
Cédric Krier 6cd05ed6fe Add has_multirow_insert
There are still many databases that doesn't support this SQL-92 syntax.

issue4881
review19331002
2015-07-28 08:04:29 +02:00
Cédric Krier e4c8f59b80 Allow to import backend from entry points
issue4841
review20301002
2015-07-09 15:40:21 +02:00
Cédric Krier 7459aab3d1 Use CURRENT_TIMESTAMP instead of NOW
CURRENT_TIMESTAMP is the correct SQL standard way.

issue4837
review15531002
2015-07-01 19:41:49 +02:00
Cédric Krier 44dc331ced Use Constraint instance in ModelSQL._sql_constraints
issue4814
review15491002
2015-06-22 16:57:06 +02:00
Cédric Krier eddb17dea7 Re-factor dict* methods on each cursor into the interface
issue4807
review7241002
2015-06-15 01:18:07 +02:00
Cédric Krier 1db32e9a7a Fix constraint name in init.sql files
They must follow the framework naming scheme

issue4790
review18291002
2015-06-04 18:27:08 +02:00
Cédric Krier 52ff97b165 Rename ir.module.module* into ir.module*
issue4764
review7171002
2015-05-28 21:02:01 +02:00
Cédric Krier 87ea42c126 Unquote username and password from URI
issue4747
review7131002
2015-05-19 09:48:07 +02:00
Albert Cervera i Areny f707c695e4 Close template1 connection on database restore.
review6241002
issue4717
2015-04-27 22:49:25 +02:00
Cédric Krier b9e9964157 Fix Greatest and Least for SQLite
issue4597
review12051002
2015-03-24 22:04:12 +01:00
Cédric Krier 58b357b55f Improve config to be Python3 compatible
issue4662
review14131002
2015-03-22 03:20:53 +01:00
Cédric Krier 4be42a5b50 Fix encoding/decoding in adapter/converter of sqlite for Python3
bytes must be used when storing raw values of adapter in blob
bytes is received by the converter and so it must be decoded into unicode

issue3211
2015-03-19 21:44:54 +01:00
Cédric Krier 31e8634bf4 Fix bytes and bytearray usage
- sqlite can not convert bytearray, must use buffer
- binary value could be stored as unicode
- don't dump bytes as base64 in xmlrpclib if bytes is str
2015-03-16 20:13:03 +01:00
Cédric Krier 5cfde31ed2 Use bytes and bytearray for Binary
issue4637
review11091002
2015-03-16 19:28:34 +01:00
Cédric Krier 39e7eeeadb Add support for psycopg2cffi and PyPy
issue4408
review11741002
2015-03-15 15:52:03 +01:00
Cédric Krier 20484bb013 Fix formatting in logger calls 2015-03-05 11:32:18 +01:00
Sergi Almacellas Abellana 5436fe6cee Add support for Greatest and Least on SQLite
issue4597
review13011002
2015-03-04 18:15:06 +01:00
Cédric Krier 0ac0990c77 Improve logging
issue4458
review11781002
2015-03-02 23:39:15 +01:00
Cédric Krier 5a34e18b75 Fix SQLite convert interval for min/max value
The total_seconds of timedelta min and max can not be used to instanciate a
timedelta. So we need to test for such case and return timedelta min or max.
2015-02-09 23:36:32 +01:00
Cédric Krier 0991a552de Add TimeDelta field
And remove float_time widget.

issue4026
review5911002
2015-02-09 22:58:56 +01:00
Cédric Krier 288dc51876 SQL SIGN must return zero for zero
The SQLite implementation of SIGN is not correct for zero, it must return zero
instead of 1.

issue4518
review10831002
2015-02-04 23:19:45 +01:00
Cédric Krier de081a63e8 Fix typo when retrieving PGUSER from environ
introduced in changeset 277c10477f84
2015-01-17 17:19:44 +01:00
Mariano Benedettini 53194e3784 Fix database dump when port is specified in db uri
Since changeset 01399128964f, the uri port is an integer and so it must be
convert to string for command line.

issue4490
review6861002
2015-01-16 13:52:25 +01:00
Cédric Krier 4891d337c9 Use PGUSER for postgresql database list
psycopg2 uses the PGUSER environment variable if no user name defined.

issue4478
review11801002
2015-01-15 23:49:13 +01:00
Cédric Krier 324d75ec8c Use NOWAIT when locking a table
lock is used to enforce a serializable level for all transaction using on the
same table. This is not achieved if transactions are waiting for the lock
instead of abort and retry with a new transaction because they will still have
the initial transaction row values with the repeatable read level.

issue4373
review5901002
2015-01-03 11:37:24 +01:00
Cédric Krier 67d5291bfd Use Field.sql_column for SELECT queries in ModelSQL
By using sql_column, it increases the possibilities of customisation of fields.

issue4369
review14711002
2014-12-20 19:24:42 +01:00
Cédric Krier c144f8c349 Fix most flake8 errors
review8771002
2014-12-02 12:54:01 +01:00
Cédric Krier 360f39f89d Make cache size configurable
* Clean private context keyword in RPC
* Add cache section in configuration

issue4320
review10641002
2014-11-19 21:35:51 +01:00
Cédric Krier 41bd15b31e Use sequence as parameter of query for MySQLdb >= 1.2.5
issue4149
review7531002
2014-09-04 00:19:39 +02:00
Cédric Krier e0b995abbe Refactore configuration to allow easy extention
issue3627
review7401002
2014-09-03 23:32:01 +02:00
Cédric Krier 49ce719d0e Add SQLite support for char_length
review10331002
2014-05-27 22:32:26 +02:00
Cédric Krier 67dfdc6a99 Make global cache depends on explicit context keys
This should prevent the invalidation of the cache when the context keys that are
changed has no influence onn the global cache.

issue3905
review6291002
2014-05-22 23:36:00 +02:00
Cédric Krier 6b3f7fb250 Add sign function to SQLite backend
review3411002
2014-02-14 00:00:09 +01:00
Cédric Krier e60274bd27 Fix MySQL tests
- Force UTC timezone on MySQL connection
- Add 1s sleep to test check timestamp

review2801002
2014-01-21 21:12:55 +01:00
Albert Cervera i Areny ce781a5d0e Use EXCLUSIVE MODE when locking PostgreSQL tables.
Previous implementation used ACCESS EXCLUSIVE MODE (PostgreSQL's default) which
does not allow SELECTs on the locked table. This is too pessimistic so it's been
replaced by a plain EXCLUSIVE MODE which still blocks INSERTs and UPDATEs
but not SELECTs.

review1011002
issue2280
2013-12-19 20:58:13 +01:00
Cédric Krier c46a026c40 Refactore Transaction to add close and autocommit
review2151002
2013-12-18 18:09:43 +01:00
Cédric Krier 17bbcef17d Remove unused regexp
review2081002
2013-12-06 11:45:07 +01:00
Cédric Krier be197317c8 Ensure same time zone between trytond and postgresql
issue3423
review1135002
2013-10-14 21:05:36 +02:00
Cédric Krier 5ad27258fd Fix flake8 2013-10-05 18:18:42 +02:00