rename module
This commit is contained in:
parent
bdd5395a4a
commit
f897c66639
|
@ -1,6 +1,6 @@
|
|||
# Barkshark Async HTTP
|
||||
# IzzyLib SQL
|
||||
|
||||
A simple HTTP client and server framework based on the built-in asyncio module.
|
||||
A simple SQL client wrapper for sqlite, postgresql, and mysql.
|
||||
|
||||
# NOTE
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
import asyncio
|
||||
|
||||
from .database import Database
|
||||
|
||||
|
||||
class client:
|
||||
pass
|
||||
|
||||
|
||||
class Server:
|
||||
pass
|
|
@ -2,10 +2,7 @@ import sqlite3
|
|||
|
||||
from getpass import getuser
|
||||
from importlib import import_module
|
||||
from izzylib import (
|
||||
BaseConfig,
|
||||
Path
|
||||
)
|
||||
from izzylib import BaseConfig, Path
|
||||
|
||||
from .result import Result
|
||||
from .row import Row
|
|
@ -1,10 +1,6 @@
|
|||
import itertools
|
||||
|
||||
from izzylib import (
|
||||
DotDict,
|
||||
Path,
|
||||
izzylog
|
||||
)
|
||||
from izzylib import DotDict, Path, izzylog
|
||||
|
||||
from .config import Config
|
||||
from .row import Row
|
||||
|
@ -110,7 +106,7 @@ class Database:
|
|||
|
||||
|
||||
def load_tables(self, tables=None):
|
||||
if tables:
|
||||
if tables != None:
|
||||
self.tables.load_tables(tables)
|
||||
return self.tables
|
||||
|
||||
|
@ -161,14 +157,14 @@ class Connection:
|
|||
def __init__(self, db):
|
||||
self.db = db
|
||||
self.cfg = db.cfg
|
||||
self.sessions = []
|
||||
self.sessions = {}
|
||||
self.conn = None
|
||||
|
||||
self.connect()
|
||||
|
||||
if db.tables.empty:
|
||||
with self.session as s:
|
||||
db.load_tables(s.table_layout())
|
||||
#if db.tables.empty:
|
||||
#with self.session as s:
|
||||
#db.load_tables(s.table_layout())
|
||||
|
||||
|
||||
@property
|
|
@ -1,36 +1,13 @@
|
|||
import json
|
||||
|
||||
from pathlib import Path as PyPath
|
||||
from izzylib import DotDict, Path, convert_to_boolean, izzylog, random_gen
|
||||
|
||||
from .exceptions import NoTransactionError, UpdateAllRowsError
|
||||
from .result import Result
|
||||
from .row import Row
|
||||
|
||||
from izzylib import (
|
||||
DotDict,
|
||||
Path,
|
||||
boolean,
|
||||
izzylog,
|
||||
random_gen
|
||||
)
|
||||
|
||||
from .exceptions import (
|
||||
NoTransactionError,
|
||||
UpdateAllRowsError
|
||||
)
|
||||
|
||||
from .statements import (
|
||||
Count,
|
||||
Delete,
|
||||
Insert,
|
||||
Select,
|
||||
Statement,
|
||||
Update
|
||||
)
|
||||
|
||||
from .table import (
|
||||
SessionTables,
|
||||
DbColumn
|
||||
)
|
||||
from .statements import Count, Delete, Insert, Select, Statement, Update
|
||||
from .table import SessionTables, DbColumn
|
||||
|
||||
|
||||
class Session:
|
||||
|
@ -44,6 +21,9 @@ class Session:
|
|||
self.cursor = conn.cursor()
|
||||
self.trans = False
|
||||
|
||||
if self.db.tables.empty:
|
||||
self.db.load_tables(self.table_layout())
|
||||
|
||||
self.__setup__()
|
||||
|
||||
|
||||
|
@ -265,7 +245,7 @@ class Session:
|
|||
if self.db.tables and table not in self.db.tables:
|
||||
raise KeyError(f'Table does not exist: {table}')
|
||||
|
||||
self.run(Delete(table, self._parse_data('deserialize', table, kwargs)))
|
||||
self.run(Delete(table, **self._parse_data('deserialize', table, kwargs)))
|
||||
|
||||
|
||||
def remove_row(self, row):
|
||||
|
@ -335,7 +315,7 @@ class Session:
|
|||
|
||||
tables[table][column] = dict(
|
||||
type = row.data_type.upper(),
|
||||
nullable = boolean(row.is_nullable),
|
||||
nullable = convert_to_boolean(row.is_nullable),
|
||||
default = row.column_default if row.column_default and not row.column_default.startswith('nextval') else None,
|
||||
primary_key = None,
|
||||
foreign_key = None,
|
|
@ -1,7 +1,4 @@
|
|||
from izzylib import (
|
||||
DotDict,
|
||||
LruCache
|
||||
)
|
||||
from izzylib import DotDict, LruCache
|
||||
|
||||
|
||||
class SessionTables:
|
|
@ -1,10 +1,5 @@
|
|||
from datetime import date, time, datetime
|
||||
|
||||
from izzylib import (
|
||||
DotDict,
|
||||
LowerDotDict,
|
||||
izzylog
|
||||
)
|
||||
from izzylib import DotDict, LowerDotDict, izzylog
|
||||
|
||||
|
||||
Standard = {
|
12
setup.cfg
12
setup.cfg
|
@ -1,9 +1,9 @@
|
|||
[metadata]
|
||||
name = Barkshark SQL
|
||||
name = IzzyLib SQL
|
||||
version = 0.1.0
|
||||
author = Zoey Mae
|
||||
author_email = zoey@barkshark.xyz
|
||||
url = https://git.barkshark.xyz/izaliamae/barkshark-sql
|
||||
url = https://git.barkshark.xyz/izaliamae/izzylib-sql
|
||||
description = Simple SQL client
|
||||
license = CNPL 6+
|
||||
license_file = LICENSE
|
||||
|
@ -20,14 +20,14 @@ classifiers =
|
|||
Programming Language :: Python 3.9
|
||||
Topic :: Software Development :: Libraries :: Python Modules
|
||||
project_urls =
|
||||
Bug Tracker = https://git.barkshark.xyz/izaliamae/barkshark-sql/issues
|
||||
Documentation = https://git.barkshark.xyz/izaliamae/barkshark-sql/wiki
|
||||
Source Code = https://git.barkshark.xyz/izaliamae/barkshark-sql
|
||||
Bug Tracker = https://git.barkshark.xyz/izaliamae/izzylib-sql/issues
|
||||
Documentation = https://git.barkshark.xyz/izaliamae/izzylib-sql/wiki
|
||||
Source Code = https://git.barkshark.xyz/izaliamae/izzylib-sql
|
||||
|
||||
[options]
|
||||
python_requires = >= 3.6
|
||||
packages =
|
||||
barkshark_sql
|
||||
izzylib_sql
|
||||
setup_requires =
|
||||
setuptools >= 38.3.0
|
||||
install_requires =
|
||||
|
|
Loading…
Reference in a new issue