1. 09 Feb, 2021 3 commits
  2. 13 Mar, 2019 1 commit
  3. 21 May, 2019 1 commit
    • Laurent Peuch's avatar
      [database/exception] include the query information in database error for better debuging · 65caef71dc24
      Laurent Peuch authored
      This will change an exception from something like :
      
          psycopg2.IntegrityError: null value in column "asource" violates not-null constraint
          DETAIL:  Failing row contains (341471, CWRType, null, null).
      
      To:
      
          psycopg2.IntegrityError: when doing the query 'INSERT INTO entities ( eid, type ) VALUES ( %(eid)s, %(type)s )' with the args '{'type': u'CWRType', 'eid': 341471}' got the error 'null value in column "asource" violates not-null constraint
          DETAIL:  Failing row contains (341471, CWRType, null, null).'
      
      Tested with sqlite3 and postgresql.
      65caef71dc24
  4. 08 Feb, 2021 1 commit
  5. 11 Dec, 2020 1 commit
  6. 27 Jan, 2021 1 commit
  7. 03 Feb, 2021 1 commit
  8. 02 Nov, 2016 1 commit
  9. 13 Oct, 2016 1 commit
  10. 14 Nov, 2016 1 commit
  11. 27 Jan, 2021 1 commit
  12. 22 May, 2020 1 commit
  13. 08 Jul, 2020 1 commit
  14. 26 Jan, 2021 3 commits
  15. 19 Jan, 2021 3 commits
  16. 21 Jan, 2021 1 commit
  17. 19 Jan, 2021 6 commits
  18. 15 Jan, 2021 2 commits
  19. 19 Jan, 2021 1 commit
  20. 26 Jan, 2021 4 commits
  21. 19 Jan, 2021 1 commit
  22. 12 Jan, 2021 1 commit
  23. 06 Jan, 2021 1 commit
  24. 17 Dec, 2020 2 commits
    • Simon Chabot's avatar
      fix(ci): use **/*.py to match all python files · 826328052e46
      Simon Chabot authored
      826328052e46
    • Simon Chabot's avatar
      fix(rql2sql): properly handle date and datetime operations with SQLite · be2138f52fb6
      Simon Chabot authored
      Different DB backends are used by CW, mainly postgresql and sqlite.
      According to RQL's documentation:
      
          Any N WHERE N is Note, N written_on D, D day> (today -10), N written_by P, P name 'jphc' or P name 'ocy'
      
      should return all the notes less than 10 days old written by jphc or ocy.
      
      but, as described in #109, it only works with postgresql, which is *not*
      mentioned in the documentation.
      
      TODAY is working well in sqlite, but not the operations with TODAY.
      TODAY is translated to 'CURRENT_DATE' in sqlite, and `SELECT CURRENT_DATE - 3`
      return the current year minus three, and *not the current date minus 3 days* as
      expected according to the documentation.
      
      A lot of tests in CW are performed with SQLite (because it's fast to set up!),
      so… let's make it work !
      
      This patch suggests to adapt the 'visit_mathexpression' method, to write the
      expected SQL when were are dealing with:
      
      - sqlite
      - a date(time) on the left (left-hand-side, lhs)
      - a integer (treated as an amount of days) on the right (right-hand-side, rhs)
      
      
      The tests have been updated to check that the conversion rql to sql is the
      expected one, according to the backend.
      
      
      close #109
      be2138f52fb6