@@ -34,7 +34,7 @@ def __init__(
34
34
http_method : str ,
35
35
headers : Headers ,
36
36
params : QueryParams ,
37
- json : dict ,
37
+ json : Union [ dict , list ] ,
38
38
) -> None :
39
39
self .session = session
40
40
self .path = path
@@ -289,7 +289,7 @@ def select(
289
289
*columns: The names of the columns to fetch.
290
290
count: The method to use to get the count of rows returned.
291
291
Returns:
292
- :class:`AsyncSelectRequestBuilder `
292
+ :class:`SyncSelectRequestBuilder `
293
293
"""
294
294
method , params , headers , json = pre_select (* columns , count = count )
295
295
return SyncSelectRequestBuilder [_ReturnT ](
@@ -303,6 +303,7 @@ def insert(
303
303
count : Optional [CountMethod ] = None ,
304
304
returning : ReturnMethod = ReturnMethod .representation ,
305
305
upsert : bool = False ,
306
+ default_to_null : bool = True ,
306
307
) -> SyncQueryRequestBuilder [_ReturnT ]:
307
308
"""Run an INSERT query.
308
309
@@ -311,14 +312,18 @@ def insert(
311
312
count: The method to use to get the count of rows returned.
312
313
returning: Either 'minimal' or 'representation'
313
314
upsert: Whether the query should be an upsert.
315
+ default_to_null: Make missing fields default to `null`.
316
+ Otherwise, use the default value for the column.
317
+ Only applies for bulk inserts.
314
318
Returns:
315
- :class:`AsyncQueryRequestBuilder `
319
+ :class:`SyncQueryRequestBuilder `
316
320
"""
317
321
method , params , headers , json = pre_insert (
318
322
json ,
319
323
count = count ,
320
324
returning = returning ,
321
325
upsert = upsert ,
326
+ default_to_null = default_to_null ,
322
327
)
323
328
return SyncQueryRequestBuilder [_ReturnT ](
324
329
self .session , self .path , method , headers , params , json
@@ -332,6 +337,7 @@ def upsert(
332
337
returning : ReturnMethod = ReturnMethod .representation ,
333
338
ignore_duplicates : bool = False ,
334
339
on_conflict : str = "" ,
340
+ default_to_null : bool = True ,
335
341
) -> SyncQueryRequestBuilder [_ReturnT ]:
336
342
"""Run an upsert (INSERT ... ON CONFLICT DO UPDATE) query.
337
343
@@ -341,15 +347,20 @@ def upsert(
341
347
returning: Either 'minimal' or 'representation'
342
348
ignore_duplicates: Whether duplicate rows should be ignored.
343
349
on_conflict: Specified columns to be made to work with UNIQUE constraint.
350
+ default_to_null: Make missing fields default to `null`. Otherwise, use the
351
+ default value for the column. This only applies when inserting new rows,
352
+ not when merging with existing rows under `ignoreDuplicates: false`.
353
+ This also only applies when doing bulk upserts.
344
354
Returns:
345
- :class:`AsyncQueryRequestBuilder `
355
+ :class:`SyncQueryRequestBuilder `
346
356
"""
347
357
method , params , headers , json = pre_upsert (
348
358
json ,
349
359
count = count ,
350
360
returning = returning ,
351
361
ignore_duplicates = ignore_duplicates ,
352
362
on_conflict = on_conflict ,
363
+ default_to_null = default_to_null ,
353
364
)
354
365
return SyncQueryRequestBuilder [_ReturnT ](
355
366
self .session , self .path , method , headers , params , json
@@ -369,7 +380,7 @@ def update(
369
380
count: The method to use to get the count of rows returned.
370
381
returning: Either 'minimal' or 'representation'
371
382
Returns:
372
- :class:`AsyncFilterRequestBuilder `
383
+ :class:`SyncFilterRequestBuilder `
373
384
"""
374
385
method , params , headers , json = pre_update (
375
386
json ,
@@ -392,7 +403,7 @@ def delete(
392
403
count: The method to use to get the count of rows returned.
393
404
returning: Either 'minimal' or 'representation'
394
405
Returns:
395
- :class:`AsyncFilterRequestBuilder `
406
+ :class:`SyncFilterRequestBuilder `
396
407
"""
397
408
method , params , headers , json = pre_delete (
398
409
count = count ,
0 commit comments