Skip to content

Commit f53213b

Browse files
committed
fix: update cfg, remove check warnings
1 parent 289347c commit f53213b

File tree

3 files changed

+39
-22
lines changed

3 files changed

+39
-22
lines changed

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
[metadata]
1818
name = Spotrix
1919
summary = a data exploration platform
20-
description-file = README.md
20+
description_file = README.md
2121
author = ciusji
22-
author-email = [email protected]
22+
author_email = [email protected]
2323
license = Apache License, Version 2.0
2424

2525
[files]

spotrix/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ def _try_json_readsha( # pylint: disable=unused-argument
162162
SECRET_KEY = "\2\1thisismyscretkey\1\2\\e\\y\\y\\h"
163163

164164
# The SQLAlchemy connection string.
165-
# SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(DATA_DIR, "spotrix.db")
166-
SQLALCHEMY_DATABASE_URI = 'postgresql://admin:123456@localhost:5432/spotrix'
165+
SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(DATA_DIR, "spotrix.db")
166+
# SQLALCHEMY_DATABASE_URI = 'postgresql://admin:123456@localhost:5432/spotrix'
167167

168168
# In order to hook up a custom password store for all SQLACHEMY connections
169169
# implement a function that takes a single argument of type 'sqla.engine.url',

tests/unit_tests/db_engine_specs/db_testing.py

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,39 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
2222

23-
# import sqlalchemy
24-
# from sqlalchemy import Table, Column, String, MetaData
25-
#
26-
# engine = sqlalchemy.create_engine('postgres://admin:123456@localhost:5432/spotrix')
23+
import sqlalchemy
24+
from sqlalchemy import Table, Column, String, MetaData
25+
26+
engine = sqlalchemy.create_engine('postgresql://sa:sa@localhost:5435/xxx')
27+
28+
with engine.connect() as connection:
29+
metadata = MetaData()
30+
tables = Table('tables', metadata,
31+
Column('table_schema', String),
32+
Column('table_name', String),
33+
schema='information_schema')
34+
results = connection.execute(
35+
tables.select().where(tables.c.table_schema == 'pg_catalog'))
36+
for result in results:
37+
print(result)
38+
39+
# Create
40+
engine.execute("CREATE TABLE IF NOT EXISTS films (title text, director text, year_yy text)")
41+
engine.execute("INSERT INTO films (title, director, year_yy) VALUES ('Doctor Strange', 'Scott Derrickson', '2016')")
42+
43+
# Read
44+
result_set = engine.execute("SELECT * FROM films")
45+
for r in result_set:
46+
print(r)
47+
48+
# Update
49+
engine.execute("UPDATE films SET title='Some2016Film' WHERE year_yy='2016'")
50+
51+
# Delete
52+
engine.execute("DELETE FROM films WHERE year_yy='2016'")
53+
54+
55+
# import duckdb
2756
#
28-
# with engine.connect() as connection:
29-
# metadata = MetaData()
30-
# tables = Table('tables', metadata,
31-
# Column('table_schema', String),
32-
# Column('table_name', String),
33-
# schema = 'information_schema')
34-
# results = connection.execute(tables.select().where(tables.c.table_schema=='pg_catalog'))
35-
# for result in results:
36-
# print(result)
37-
38-
import duckdb
39-
40-
cursor = duckdb.connect()
41-
print(cursor.execute('SELECT 42').fetchall())
57+
# cursor = duckdb.connect()
58+
# print(cursor.execute('SELECT 42').fetchall())

0 commit comments

Comments
 (0)