David Wobrock
2ee7dac3b3
Add internal classes and add type hints + mypy.
2022-12-26 16:26:24 +01:00
David Wobrock
e8f83708b0
Run black.
2022-11-03 22:00:00 +01:00
Sondre Lillebø Gundersen
bd4eb89b8c
chore: Upgrade Python syntax with pyupgrade
...
Run with the following pre-commit configuration:
```
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
hooks:
- id: pyupgrade
args: [ "--py3-plus", "--py36-plus", "--py37-plus" ]
```
The rationale for every change can be found at https://github.com/asottile/pyupgrade
2022-11-03 22:00:00 +01:00
Sören Wegener
a3fc5f1a50
Improve error message when an unsupported database vendor/SQL analyser was selected.
2022-10-03 15:48:11 +02:00
David Wobrock
76a55dbb12
Raise when unsupported db vendor, and add option to specify SQL analyser
2022-01-30 15:20:18 +01:00
David Wobrock
3219f9cf8a
Handle creating a unique index as adding a unique constraint
2022-01-28 21:23:44 +01:00
David Wobrock
7674a51bc9
Fix #178 -- Don't detect an index creation when the table is being created
2021-12-20 22:38:54 +01:00
Christian Bundy
397c1f0e16
Default ends_with_default to False
...
Problem: Previously in gh-117 we aimed to solve gh-115, which described a problem where we used `SET DEFAULT` and then `DROP DEFAULT` immediately afterward. The solution was to track whether any defaults are retained, but the `ends_with_default` variable is initialized as `None` rather than `False`. At the end of the function we check whether `ends_with_default is False`, never occurs unless a default is set.
Solution: Assume that there is no default unless proven otherwise, and iniitializie `ends_with_default` to `False` instead of `None`.
Fixes: gh-158
2021-08-14 15:22:24 +02:00
David Wobrock
fa56196f04
Add PG reindex linting warning and improve some smaller stuff
2021-06-19 18:15:40 +02:00
David Wobrock
27e492996c
Apply black
2021-06-19 18:15:40 +02:00
David Wobrock
2bf87c0659
Add Postgresql warning when using DROP INDEX without CONCURRENTLY keyword
2021-06-19 18:15:40 +02:00
David Wobrock
343d163c88
Add Postgresql warning when using CREATE INDEX without CONCURRENTLY keyword
2021-06-19 18:15:40 +02:00
David Wobrock
9ea8872a29
Add warnings type to SQL analyser
2021-06-19 18:15:40 +02:00
David-Wobrock
d207bf14b3
Fix import order which was important
2020-11-30 21:58:28 +01:00
David-Wobrock
e51073ef46
Fixes #129 - use single logger
2020-11-30 21:53:38 +01:00
David-Wobrock
6ab1d58c47
Apply isort to the project
2020-11-30 21:46:40 +01:00
David Wobrock
b3816613d5
Fix #115 -- Detect correctly if a field ends with a default value or a dropped default
2020-06-20 18:08:16 +02:00
David Wobrock
71614bd377
Handle warning as error and exclude warning tests
2020-02-07 23:29:15 +01:00
David Wobrock
813c5c8690
Remove apache license headers in each file. The one full copy of the license at the root of the repo shall define the license for all source files.
2020-01-11 22:08:33 +01:00
David Wobrock
1d9f4b7b86
Make sqlite and mysql table and column detection a little bit more resilient for UX
2019-10-21 22:27:25 +02:00
David Wobrock
a31282a4d8
Make base detection of table and column more resilient
2019-10-21 22:27:25 +02:00
David Wobrock
7fad69659c
Refactor: move build_error_dict into the Analyser call, since it will be backend specific
2019-10-21 22:27:25 +02:00
David Wobrock
18c271101d
Refactor: remove redundant function call
2019-10-21 22:27:25 +02:00
David Wobrock
b252c203f5
Add logic that adding a unique constraint is only an error when the table has not been created in the same transaction
2019-10-21 22:25:01 +02:00
David Wobrock
e408cd2c5e
Add SQL analyser logic for adding unique constraint
2019-07-30 10:47:20 +02:00
David Wobrock
4128c4b018
Add logic to detect DROP TABLE
2019-07-29 23:14:30 +02:00
David Wobrock
eac9c5615f
Refactor sql_analyser into multiple classes for simpler extension in the future
2019-07-29 21:05:12 +02:00