@supabase/postgrest-js
Advanced tools
Comparing version 0.32.0 to 0.33.0
@@ -48,7 +48,9 @@ import { PostgrestBuilder } from './types'; | ||
* @param count Count algorithm to use to count rows in a table. | ||
* @param ignoreDuplicates Specifies if duplicate rows should be ignored and not inserted. | ||
*/ | ||
upsert(values: Partial<T> | Partial<T>[], { onConflict, returning, count, }?: { | ||
upsert(values: Partial<T> | Partial<T>[], { onConflict, returning, count, ignoreDuplicates, }?: { | ||
onConflict?: string; | ||
returning?: 'minimal' | 'representation'; | ||
count?: null | 'exact' | 'planned' | 'estimated'; | ||
ignoreDuplicates?: boolean; | ||
}): PostgrestFilterBuilder<T>; | ||
@@ -55,0 +57,0 @@ /** |
@@ -75,6 +75,10 @@ "use strict"; | ||
* @param count Count algorithm to use to count rows in a table. | ||
* @param ignoreDuplicates Specifies if duplicate rows should be ignored and not inserted. | ||
*/ | ||
upsert(values, { onConflict, returning = 'representation', count = null, } = {}) { | ||
upsert(values, { onConflict, returning = 'representation', count = null, ignoreDuplicates = false, } = {}) { | ||
this.method = 'POST'; | ||
const prefersHeaders = ['resolution=merge-duplicates', `return=${returning}`]; | ||
const prefersHeaders = [ | ||
`resolution=${ignoreDuplicates ? 'ignore' : 'merge'}-duplicates`, | ||
`return=${returning}`, | ||
]; | ||
if (onConflict !== undefined) | ||
@@ -81,0 +85,0 @@ this.url.searchParams.set('on_conflict', onConflict); |
@@ -48,7 +48,9 @@ import { PostgrestBuilder } from './types'; | ||
* @param count Count algorithm to use to count rows in a table. | ||
* @param ignoreDuplicates Specifies if duplicate rows should be ignored and not inserted. | ||
*/ | ||
upsert(values: Partial<T> | Partial<T>[], { onConflict, returning, count, }?: { | ||
upsert(values: Partial<T> | Partial<T>[], { onConflict, returning, count, ignoreDuplicates, }?: { | ||
onConflict?: string; | ||
returning?: 'minimal' | 'representation'; | ||
count?: null | 'exact' | 'planned' | 'estimated'; | ||
ignoreDuplicates?: boolean; | ||
}): PostgrestFilterBuilder<T>; | ||
@@ -55,0 +57,0 @@ /** |
@@ -70,6 +70,10 @@ import { PostgrestBuilder } from './types'; | ||
* @param count Count algorithm to use to count rows in a table. | ||
* @param ignoreDuplicates Specifies if duplicate rows should be ignored and not inserted. | ||
*/ | ||
upsert(values, { onConflict, returning = 'representation', count = null, } = {}) { | ||
upsert(values, { onConflict, returning = 'representation', count = null, ignoreDuplicates = false, } = {}) { | ||
this.method = 'POST'; | ||
const prefersHeaders = ['resolution=merge-duplicates', `return=${returning}`]; | ||
const prefersHeaders = [ | ||
`resolution=${ignoreDuplicates ? 'ignore' : 'merge'}-duplicates`, | ||
`return=${returning}`, | ||
]; | ||
if (onConflict !== undefined) | ||
@@ -76,0 +80,0 @@ this.url.searchParams.set('on_conflict', onConflict); |
{ | ||
"name": "@supabase/postgrest-js", | ||
"version": "0.32.0", | ||
"version": "0.33.0", | ||
"description": "Isomorphic PostgREST client", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -128,2 +128,3 @@ import { PostgrestBuilder } from './types' | ||
* @param count Count algorithm to use to count rows in a table. | ||
* @param ignoreDuplicates Specifies if duplicate rows should be ignored and not inserted. | ||
*/ | ||
@@ -136,2 +137,3 @@ upsert( | ||
count = null, | ||
ignoreDuplicates = false, | ||
}: { | ||
@@ -141,2 +143,3 @@ onConflict?: string | ||
count?: null | 'exact' | 'planned' | 'estimated' | ||
ignoreDuplicates?: boolean | ||
} = {} | ||
@@ -146,3 +149,6 @@ ): PostgrestFilterBuilder<T> { | ||
const prefersHeaders = ['resolution=merge-duplicates', `return=${returning}`] | ||
const prefersHeaders = [ | ||
`resolution=${ignoreDuplicates ? 'ignore' : 'merge'}-duplicates`, | ||
`return=${returning}`, | ||
] | ||
@@ -149,0 +155,0 @@ if (onConflict !== undefined) this.url.searchParams.set('on_conflict', onConflict) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
195247
3623