Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
81743f0
fixdeps
djrobstep Sep 29, 2020
ab80782
Filter out extensions when skipping internals
spoykko Sep 29, 2020
11c4f1b
Adapt extension test with --timescale option
spoykko Oct 1, 2020
de405c8
create ext if not exists
djrobstep Oct 1, 2020
9e331a5
Add the ability to exclude a schema instead of just do a single schema
jasongi-actu Oct 6, 2020
8eea715
fix the spelling of comparator
jasongi-actu Oct 6, 2020
2a78978
deps ext fix
djrobstep Oct 9, 2020
d0b7cf4
improved index inspection
djrobstep Oct 17, 2020
bef2d6c
inheritance-related fixes, back compat for index inspection
djrobstep Oct 18, 2020
6aae164
fix broken pg10 test
djrobstep Oct 18, 2020
5ba6b14
pg10 compat fix
djrobstep Oct 18, 2020
d9cf933
skip part of inheritance test with <=9
djrobstep Oct 18, 2020
9cf00e7
Compatibility with postgres 9.5
trendels Oct 23, 2020
94559ec
fix fk info
djrobstep Dec 6, 2020
f04c2c2
better deferrable handling
djrobstep Jan 13, 2021
f9acb36
cleaned up func inspection query
djrobstep Jan 18, 2021
8a9e062
fix <12 func query
djrobstep Jan 18, 2021
d275e98
fix <12 func query again
djrobstep Jan 18, 2021
1886fb7
fix <12 func query again
djrobstep Jan 18, 2021
72fb20f
fix <12 func query again
djrobstep Jan 18, 2021
a39610a
fix <12 func query again
djrobstep Jan 18, 2021
2c7c0ea
inheritance deps
djrobstep Jan 27, 2021
04362b3
fix test pg9
djrobstep Jan 27, 2021
3d6312a
major version bump to 3, no more py2 support
djrobstep Jan 27, 2021
6cfc413
final py2 release
djrobstep Jan 28, 2021
04e8948
fixbuild
djrobstep Jan 28, 2021
b0fcdd7
first py3 only release
djrobstep Jan 28, 2021
6647b9d
fix sqlalchemy issue
djrobstep Mar 17, 2021
fc8d925
vbump sqlbag
djrobstep Mar 18, 2021
114e6aa
Fix: an existing index == None should return False
SKalt Apr 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,6 @@ jobs:
- store_artifacts:
path: test-reports/
destination: tr1
build-py2:
working_directory: ~/circleci
docker:
- image: circleci/python:2.7.18
- image: circleci/postgres:12
environment:
POSTGRES_USER: circleci
POSTGRES_DB: circleci
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- checkout
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "pyproject.toml" }}
- run:
name: Wait for db
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run: sudo apt-get install -y postgresql-client
- run:
name: create postgres user
command: psql postgresql://@localhost/circleci -c 'create role postgres'
- run:
name: Install poetry
command: |
sudo pip install poetry autovenv
poetry config virtualenvs.create false
- run:
command: |
poetry install
- run:
command: |
make test
- store_artifacts:
path: test-reports/
destination: tr1

build-pg11:
working_directory: ~/circleci
Expand Down Expand Up @@ -257,7 +223,6 @@ workflows:
build-then-publish:
jobs:
- build
- build-py2
- build-pg11
- build-pg10
- build-pg9
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ clean:
find . -name \*.pyc -delete

fmt:
isort -rc .
isort .
black .

lint:
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "schemainspect"
version = "0.1"
version = "3.0"
authors = [ "Robert Lechte <[email protected]>",]
license = "Unlicense"
readme = "README.md"
Expand All @@ -10,18 +10,18 @@ repository = "https://github.com/djrobstep/schemainspect"
homepage = "https://github.com/djrobstep/schemainspect"

[tool.poetry.dependencies]
python = "*"
python = ">=3.6,<4"
six = "*"
sqlalchemy = "*"

[tool.poetry.dev-dependencies]
sqlbag = "*"
pytest = "*"
sqlbag = ">=0.1.1616028516"
pytest = {version="*", python=">=3.5,<4"}
pytest-cov = "*"
pytest-clarity = ">=0.3.0-alpha.0"
pytest-clarity = {version=">=0.3.0-alpha.0", python=">=3.5,<4"}
psycopg2-binary = "*"
flake8 = "*"
isort = "*"
isort = {version=">=5", python=">=3.6,<4"}
migra = "*"
black = { version = ">=19.10b0", python=">=3.6" }

Expand Down
6 changes: 5 additions & 1 deletion schemainspect/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
SUPPORTED = {"postgresql": PostgreSQL}


def get_inspector(x, schema=None):
def get_inspector(x, schema=None, exclude_schema=None):
if schema and exclude_schema:
raise ValueError("Cannot provide both schema and exclude_schema")
if x is None:
return NullInspector()

Expand All @@ -18,4 +20,6 @@ def get_inspector(x, schema=None):
inspected = ic(c)
if schema:
inspected.one_schema(schema)
elif exclude_schema:
inspected.exclude_schema(exclude_schema)
return inspected
3 changes: 3 additions & 0 deletions schemainspect/inspected.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __init__(
is_identity=False,
is_identity_always=False,
is_generated=False,
is_inherited=False,
):
self.name = name or ""
self.dbtype = dbtype
Expand All @@ -66,6 +67,7 @@ def __init__(
self.is_identity = is_identity
self.is_identity_always = is_identity_always
self.is_generated = is_generated
self.is_inherited = is_inherited

def __eq__(self, other):
return (
Expand All @@ -80,6 +82,7 @@ def __eq__(self, other):
and self.is_identity == other.is_identity
and self.is_identity_always == other.is_identity_always
and self.is_generated == other.is_generated
and self.is_inherited == other.is_inherited
)

def alter_clauses(self, other):
Expand Down
Loading