@@ -46,13 +46,15 @@ class QueryBuilder:
46
46
]
47
47
_JOIN_TYPES : list = [
48
48
"INNER" ,
49
+ "LEFT" ,
49
50
"LEFT OUTER" ,
50
51
"RIGHT OUTER" ,
51
52
"FULL OUTER" ,
52
53
"CROSS"
53
54
]
54
55
_SQLITE_JOIN_TYPES : list = [
55
56
"INNER" ,
57
+ "LEFT" ,
56
58
"LEFT OUTER" ,
57
59
"CROSS"
58
60
]
@@ -178,7 +180,7 @@ def set_error(self, message: str = "") -> None:
178
180
self ._error = bool (message )
179
181
self ._error_message = message
180
182
if self ._print_errors and self ._error :
181
- print (self ._error_message )
183
+ print ("QueryBuilder error:" , self ._error_message )
182
184
183
185
def get_params (self ) -> tuple :
184
186
return self ._params
@@ -611,9 +613,14 @@ def update(self, table: Union[str, dict], fields: Union[list, dict]):
611
613
612
614
def join (self , table : Union [str , dict ] = "" , on : Union [str , tuple , list ] = (), join_type : str = "INNER" ):
613
615
join_type = join_type .upper ()
614
- if join_type == "" or join_type not in self ._SQLITE_JOIN_TYPES :
615
- self .set_error (f"Empty join_type or is not allowed in { inspect .stack ()[0 ][3 ]} method" )
616
- return self
616
+ if self ._db .get_driver () == 'sqlite' :
617
+ if join_type == "" or join_type not in self ._SQLITE_JOIN_TYPES :
618
+ self .set_error (f"Empty join_type or is not allowed in { inspect .stack ()[0 ][3 ]} method. Try one of these { self ._SQLITE_JOIN_TYPES } " )
619
+ return self
620
+ else :
621
+ if join_type == "" or join_type not in self ._JOIN_TYPES :
622
+ self .set_error (f"Empty join_type or is not allowed in { inspect .stack ()[0 ][3 ]} method. Try one of these { self ._JOIN_TYPES } " )
623
+ return self
617
624
618
625
if not table :
619
626
self .set_error (f"Empty table in { inspect .stack ()[0 ][3 ]} method" )
0 commit comments