Skip to content

Commit

Permalink
🏗️ Big ol rewrite (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalstapinski committed May 19, 2024
1 parent cfe2207 commit 0b46d29
Show file tree
Hide file tree
Showing 9 changed files with 827 additions and 366 deletions.
9 changes: 8 additions & 1 deletion p3orm/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
__version__ = "1.0.0-alpha.1"
__version__ = "1.0.0rc1"

from .drivers.base import Driver # noqa
from .drivers.postgres import Postgres # noqa
from .exceptions import * # noqa
from .fields import Column, ForeignKeyRelationship, ReverseOneToOneRelationship, ReverseRelationship, f # noqa
from .table import Table # noqa
from .utils import with_returning # noqa
58 changes: 2 additions & 56 deletions p3orm/drivers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,64 +8,10 @@


class Driver:
tables: list[Type[T]]
tables: list[Type[Table]]

def __init__(self, tables: list[Type[T]]) -> None:
def __init__(self, tables: list[Type[Table]]) -> None:
super().__init__()
self.tables = tables
for table in tables:
table._init_stuff(self)

#
# @abstractmethod
# async def execute_many(self):
# ...
#
# @abstractmethod
# async def execute_one(self):
# ...
#
# @abstractmethod
# async def fetch_one(self):
# ...

#
# @abstractmethod
# async def fetch_first(self):
# ...
#
# @abstractmethod
# async def fetch_many(self):
# ...
#
# @abstractmethod
# async def insert_one(self):
# ...
#
# @abstractmethod
# async def insert_many(self):
# ...
#
# @abstractmethod
# async def update_one(self):
# ...
#
# @abstractmethod
# async def update_many(self):
# ...
#
# @abstractmethod
# async def delete_one(self):
# ...
#
# @abstractmethod
# async def delete_many(self):
# ...
#
# @abstractmethod
# async def fetch_related(self):
# ...
# """
# for inserts and updates, use AliasedQuery with the .with to create a subquery that can be inserted into the parent quer to do prefetching.
# pypika docs, tutorial -> with clause
# """
Loading

0 comments on commit 0b46d29

Please sign in to comment.