Skip to content

Commit

Permalink
fix(dbapi): import all
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniele Briggi committed Aug 28, 2024
1 parent f17429d commit 8a7f686
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 35 deletions.
8 changes: 2 additions & 6 deletions sqlalchemy-sqlitecloud/sqlalchemy_sqlitecloud/provision.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from dotenv import load_dotenv
from dotenv import find_dotenv, load_dotenv
from sqlalchemy.engine import make_url
from sqlalchemy.pool import Pool
from sqlalchemy.testing.provision import (
Expand All @@ -10,17 +10,13 @@
temp_table_keyword_args,
)

_drivernames = {
"sqlitecloud",
}


@generate_driver_url.for_db("sqlitecloud")
def generate_driver_url(url, driver, query_str):
# no database specified here, it's created and used later
# eg: sqlitecloud://mynode.sqlite.cloud/?apikey=key123

load_dotenv("../../.env")
load_dotenv(find_dotenv("../../.env"))

connection_string = os.getenv("SQLITE_CONNECTION_STRING")
apikey = os.getenv("SQLITE_API_KEY")
Expand Down
32 changes: 3 additions & 29 deletions src/sqlitecloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,7 @@
# To replicate the public interface of sqlite3, we need to import
# the classes and functions from the dbapi2 module.
# To replicate the public interface of sqlite3,
# we need to import everything from the dbapi2 module.
# eg: sqlite3.connect() -> sqlitecloud.connect()
#

from .dbapi2 import (
PARSE_COLNAMES,
PARSE_DECLTYPES,
Connection,
Cursor,
Row,
adapters,
connect,
converters,
register_adapter,
register_converter,
)

__all__ = [
"VERSION",
"Connection",
"Cursor",
"connect",
"register_adapter",
"register_converter",
"PARSE_DECLTYPES",
"PARSE_COLNAMES",
"adapters",
"converters",
"Row",
]
from .dbapi2 import * # noqa

VERSION = "0.0.81"

0 comments on commit 8a7f686

Please sign in to comment.