add case_sensitive to Session.fetch

This commit is contained in:
Izalia Mae 2022-04-30 20:47:44 -04:00
parent e1089cbeac
commit 1945885b00
3 changed files with 7 additions and 3 deletions

View file

@ -73,10 +73,11 @@ class Statement:
class Select(Statement):
def __init__(self, table, *columns, **kwargs):
def __init__(self, table, *columns, case_sensitive=True, **kwargs):
super().__init__(table)
self.columns = columns
self.case_sensitive = True
for key, value in kwargs.items():
self.where(key, value)
@ -96,6 +97,9 @@ class Select(Statement):
if self._where:
data += f' WHERE {self._where}'
if not self.case_sensitive:
data += ' COLLATE NOCASE'
if self._order:
col, direc = self._order
data += f' ORDER BY "{col}" {direc}'

View file

@ -119,7 +119,7 @@ class Json(Type):
if not isinstance(value, DotDict):
value = DotDict(value)
return DotDict(value).to_json()
return value.to_json()
class Datetime(Type):

View file

@ -1,6 +1,6 @@
[metadata]
name = IzzyLib SQL
version = 0.1.0
version = 0.1.1
author = Zoey Mae
author_email = zoey@barkshark.xyz
url = https://git.barkshark.xyz/izaliamae/izzylib-sql