Skip to content

Commit 184c0b1

Browse files
authored
Merge branch 'master' into remove-mypy-ini
2 parents ceba771 + 56f2ee4 commit 184c0b1

File tree

2 files changed

+3
-28
lines changed

2 files changed

+3
-28
lines changed

duckdb_engine/__init__.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,6 @@ def execute(self, statement, parameters, context):
3535
self.c.execute(statement, parameters)
3636

3737

38-
def check_existance(connection, function: str, name: str, type_: str) -> bool:
39-
try:
40-
connection.execute(f"{function}('{name}');")
41-
except RuntimeError as e:
42-
if e.args[0].startswith(
43-
f"Catalog Error: {type_} with name {name} does not exist!"
44-
):
45-
return False
46-
else:
47-
raise
48-
else:
49-
return True
50-
51-
5238
class Dialect(postgres_dialect):
5339
_has_events = False
5440
identifier_preparer = None
@@ -70,23 +56,12 @@ def ddl_compiler(self, dialect, ddl, **kwargs):
7056
def do_execute(self, cursor, statement, parameters, context):
7157
cursor.execute(statement, parameters, context)
7258

73-
def has_table(self, connection, table_name, schema=None):
74-
return check_existance(connection, "PRAGMA show", table_name, "Table")
75-
76-
def has_sequence(self, connection, sequence_name, schema=None):
77-
# TODO: use better lookup method
78-
return check_existance(connection, "SELECT nextval", sequence_name, "Sequence")
79-
80-
def has_type(self, connection, type_name, schema=None):
81-
# duckdb doesn't support custom types
82-
return False
83-
8459
@staticmethod
8560
def dbapi():
8661
return DBAPI
8762

8863
def create_connect_args(self, u):
89-
return (), {"database": u.__to_string__(hide_password=False).split("///")[1]}
64+
return (), {"database": u.render_as_string(hide_password=False).split("///")[1]}
9065

9166
def initialize(self, connection):
9267
pass

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ readme = "README.md"
88
repository = "https://github.com/Mause/duckdb_engine"
99

1010
[tool.poetry.dependencies]
11-
python = "^3.6"
12-
duckdb = "^0.2.3"
11+
python = ">=3.6.1"
12+
duckdb = "^0.2.7"
1313
sqlalchemy = "^1.3.19"
1414

1515
[tool.poetry.dev-dependencies]

0 commit comments

Comments
 (0)