yhttp-dbmanager 9.1.0__tar.gz → 9.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yhttp_dbmanager-9.1.0/yhttp_dbmanager.egg-info → yhttp_dbmanager-9.2.0}/PKG-INFO +2 -2
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/setup.py +1 -1
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/tests/test_migrator.py +1 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/yhttp/ext/dbmanager/__init__.py +1 -1
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/yhttp/ext/dbmanager/dbmanager.py +4 -5
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/yhttp/ext/dbmanager/migration.py +3 -2
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0/yhttp_dbmanager.egg-info}/PKG-INFO +2 -2
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/yhttp_dbmanager.egg-info/requires.txt +1 -1
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/LICENSE +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/README.md +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/setup.cfg +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/tests/test_cli_createdrop.py +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/tests/test_cli_migration.py +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/tests/test_cli_usercommand.py +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/tests/test_dbmanager.py +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/tests/test_dburi.py +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/tests/test_install.py +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/yhttp/ext/dbmanager/cli.py +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/yhttp/ext/dbmanager/install.py +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/yhttp/ext/dbmanager/uri.py +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/yhttp_dbmanager.egg-info/SOURCES.txt +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/yhttp_dbmanager.egg-info/dependency_links.txt +0 -0
- {yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/yhttp_dbmanager.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yhttp-dbmanager
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.2.0
|
|
4
4
|
Summary: Database manager command line interface and API for yhttp.
|
|
5
5
|
Home-page: http://github.com/yhttp/yhttp-dbmanager
|
|
6
6
|
Author: Vahid Mardani
|
|
@@ -23,7 +23,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE
|
|
25
25
|
Requires-Dist: yhttp<10,>=9.1
|
|
26
|
-
Requires-Dist:
|
|
26
|
+
Requires-Dist: psycopg[c]
|
|
27
27
|
Dynamic: author
|
|
28
28
|
Dynamic: author-email
|
|
29
29
|
Dynamic: classifier
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import abc
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
|
|
3
|
+
import psycopg
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
class DatabaseManager(metaclass=abc.ABCMeta):
|
|
@@ -31,13 +30,13 @@ class PostgresqlManager(DatabaseManager):
|
|
|
31
30
|
|
|
32
31
|
def __init__(self, host=None, database='postgres', user=None,
|
|
33
32
|
password=None):
|
|
34
|
-
self.connection =
|
|
33
|
+
self.connection = psycopg.connect(
|
|
35
34
|
host=host,
|
|
36
35
|
dbname=database,
|
|
37
36
|
user=user,
|
|
38
|
-
password=password
|
|
37
|
+
password=password,
|
|
38
|
+
autocommit=True,
|
|
39
39
|
)
|
|
40
|
-
self.connection.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
|
|
41
40
|
|
|
42
41
|
def execute(self, query):
|
|
43
42
|
cursor = self.connection.cursor()
|
|
@@ -4,7 +4,7 @@ import importlib
|
|
|
4
4
|
from functools import cached_property
|
|
5
5
|
from contextlib import contextmanager
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import psycopg
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
VERSIONFILE_TEMPLATE = '''\
|
|
@@ -23,7 +23,7 @@ class Database:
|
|
|
23
23
|
|
|
24
24
|
@cached_property
|
|
25
25
|
def connection(self):
|
|
26
|
-
return
|
|
26
|
+
return psycopg.connect(self.url)
|
|
27
27
|
|
|
28
28
|
def commit(self):
|
|
29
29
|
self.connection.commit()
|
|
@@ -121,6 +121,7 @@ class Migrator:
|
|
|
121
121
|
|
|
122
122
|
if not os.path.exists(vdir):
|
|
123
123
|
os.mkdir(vdir)
|
|
124
|
+
open(os.path.join(vdir, '__init__.py'), 'w').close()
|
|
124
125
|
|
|
125
126
|
return vdir
|
|
126
127
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yhttp-dbmanager
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.2.0
|
|
4
4
|
Summary: Database manager command line interface and API for yhttp.
|
|
5
5
|
Home-page: http://github.com/yhttp/yhttp-dbmanager
|
|
6
6
|
Author: Vahid Mardani
|
|
@@ -23,7 +23,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE
|
|
25
25
|
Requires-Dist: yhttp<10,>=9.1
|
|
26
|
-
Requires-Dist:
|
|
26
|
+
Requires-Dist: psycopg[c]
|
|
27
27
|
Dynamic: author
|
|
28
28
|
Dynamic: author-email
|
|
29
29
|
Dynamic: classifier
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
yhttp<10,>=9.1
|
|
2
|
-
|
|
2
|
+
psycopg[c]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{yhttp_dbmanager-9.1.0 → yhttp_dbmanager-9.2.0}/yhttp_dbmanager.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|