Closed tazarov closed 1 year ago
Could you also add this possibility in the documentation in the README?
@AzisK done, sorry for the oversight :)
Good job in general, left one more comment
It would be great to test on probably to most popular database, i.e. MySQL
It would be great to test on probably to most popular database, i.e. MySQL
let me do that real quick.
MySQL seems to work:
mysql> CREATE DATABASE my_database;
Query OK, 1 row affected (0.01 sec)
mysql> USE my_database;
Database changed
mysql> CREATE TABLE person (
-> id INT PRIMARY KEY AUTO_INCREMENT,
-> first_name VARCHAR(50),
-> last_name VARCHAR(50),
-> email VARCHAR(100),
-> date_of_birth DATE
-> );
Query OK, 0 rows affected (0.05 sec)
mysql> INSERT INTO person (first_name, last_name, email, date_of_birth) VALUES
-> ('John', 'Doe', 'john.doe@example.com', '1980-01-01'),
-> ('Jane', 'Doe', 'jane.doe@example.com', '1985-05-15');
Query OK, 2 rows affected (0.03 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> CREATE INDEX my_index
-> ON person (first_name, last_name)
-> ;
Query OK, 0 rows affected (0.09 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> EXPLAIN SELECT * FROM person WHERE first_name = 'John' AND last_name = 'Doe';
+----+-------------+--------+------------+------+---------------+----------+---------+-------------+------+----------+-------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+--------+------------+------+---------------+----------+---------+-------------+------+----------+-------+
| 1 | SIMPLE | person | NULL | ref | my_index | my_index | 106 | const,const | 1 | 100.00 | NULL |
+----+-------------+--------+------------+------+---------------+----------+---------+-------------+------+----------+-------+
1 row in set, 1 warning (0.05 sec)
@AzisK do you want me to fix the lining issues?
You mean linting, right? It would be good. You can also setup https://pre-commit.com/ and it will do it for you automatically
You mean linting, right? It would be good. You can also setup https://pre-commit.com/ and it will do it for you automatically
let me do that now.
I have the following pre-commit hooks yaml if you want I can commit that too for those that want linting locally:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: check-yaml
args: ["--allow-multiple-documents"]
- id: check-xml
- id: check-merge-conflict
- id: check-case-conflict
- id: check-docstring-first
- repo: https://github.com/psf/black
# https://github.com/psf/black/issues/2493
rev: "refs/tags/23.3.0:refs/tags/23.3.0"
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args:
- "--extend-ignore=E203,E501,E503"
- "--max-line-length=88"
I believe there is no need since the repo already has pre-commit-config defined
@AzisK I think we're good to go then
Yes, everything looks good. I am merging this but the version bump will happen later. Thanks for your work again