rewrite: Update data ORM.

Fix parsing bug in Update Query.
Fix parsing bug in Insert Query.

Add mapping interface to Model.
Implement OrderMixin, with ORDER and NULLS Enums.
Add `result` field to Query.
This commit is contained in:
2022-11-07 16:04:02 +02:00
parent 322f519640
commit 872e5fd71f
4 changed files with 49 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
from typing import TypeVar, Type, Any, Optional, Generic, Union, Mapping
from typing import TypeVar, Type, Optional, Generic, Union
# from typing_extensions import Self
from weakref import WeakValueDictionary
from collections.abc import MutableMapping
@@ -170,6 +170,12 @@ class RowModel:
def __init__(self, data):
self.data = data
def __getitem__(self, key):
return self.data[key]
def __setitem__(self, key, value):
self.data[key] = value
@classmethod
def bind(cls, connector: Connector):
if cls.table is None: