Skip to content

Commit

Permalink
Merge pull request #2 from elliotchance/release/0.2.0
Browse files Browse the repository at this point in the history
Release/0.2.0
  • Loading branch information
elliotchance authored Mar 15, 2017
2 parents 9b1d81a + 63ba5fb commit f549787
Show file tree
Hide file tree
Showing 104 changed files with 6,473 additions and 803 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.pyc
/.idea
/test.db
/dbs/features.json
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ The goal of this project is to develop a comprehensive suite of SQL tests, based
on the each of the SQL standards to be able to test to conformance of individual
SQL databases and engines.

[**View the results here**](http://htmlpreview.github.io/?https://github.com/elliotchance/sqltest/blob/master/index.html)

The [latest SQL standard](https://www.iso.org/standard/63556.html) is **not
free** and the licence does not allow all or parts of it to be published. Older
versions are either out of licence, or they don't mind, here is the
[SQL-92 standard](https://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt).

The report for SQLite3
[looks like this](http://htmlpreview.github.io/?https://github.com/elliotchance/sqltest/blob/master/report.html).


How It Works
============
Expand Down Expand Up @@ -45,19 +44,8 @@ that are executed against the actual database to produce the final report.
Progress
========
There are some key milestones that I would like to hit (represented as
versions):
* `0.1.0` - Implement all mandatory features (fairly crudly) and be able to
run it against SQLite3. This is very close to complete, you can see the
[report here](http://htmlpreview.github.io/?https://github.com/elliotchance/sqltest/blob/master/report.html).

* `0.2.0` - Add docker containers for various version of PostgreSQL and cleanup
any tests in the process.

I don't want to plan too far ahead, but I imagine by that point it should be
fairly easy to start adding more docker containers for other databases and
produce a big comparison chart.
Almost all of the mandatory features of the 2016 SQL standard have had tests
written for it, but there is a lot more work to be done.
In More Detail
Expand Down
2 changes: 1 addition & 1 deletion bnf.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def find_missing_rules(rules):

def get_paths_for_rule(rules, rule, overrides, exclude):
p = parse(iter(all_tokens(rule)))
return sorted([str(s) for s in p.resolve(rules, overrides, exclude, [])])
return sorted(list(set([str(s) for s in p.resolve(rules, overrides, exclude, [])])))

def output_rule(rules, rule_name, overrides, exclude, output_paths, output_subrules):
if output_paths:
Expand Down
Empty file added dbs/__init__.py
Empty file.
Empty file added dbs/postgresql/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions dbs/postgresql/v9_2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM postgres:9.2

RUN apt-get update
RUN apt-get install -y python-psycopg2 python-pip libyaml-dev libpython2.7-dev
RUN pip install pyyaml
16 changes: 16 additions & 0 deletions dbs/postgresql/v9_2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import psycopg2

def run_test(test):
error = None
try:
conn = psycopg2.connect("host='localhost' dbname='postgres' user='postgres' password=''")

c = conn.cursor()
for sql in test['sql']:
c.execute(sql)

conn.close()
except psycopg2.Error as e:
error = e

return error
3 changes: 3 additions & 0 deletions dbs/postgresql/v9_2/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
db:
name: PostgreSQL
version: 9.2
Loading

0 comments on commit f549787

Please sign in to comment.