Releases for RepoDb.Vertica.BulkOperations
View the NuGet package here or download it directly here.
RepoDb.Vertica.BulkOperations (v0.0.1-alpha) - Preview
Released: TBA
New
First release of the bulk operations extension for RepoDb.Vertica, built on VerticaCopyStream — Vertica.Data’s native COPY ... FROM STDIN streaming API.
Verification status: this package has been implemented and reviewed, but not yet exercised against a live Vertica instance. Verify the pseudo-table lifecycle, the
COPYstream’s value formatting (dates, booleans, binary), and the identity-read-back arithmetic end-to-end before relying on this package in production.
What’s included
- BulkInsert, BulkMerge, BulkUpdate, BulkDelete and BulkDeleteByKey, each with an
Asyncoverload, callable against aVerticaConnectionwith an entity list, aDataTable, or anIDataReader(BulkDeleteByKeytakes a list of primary key values instead). - An internal
COPY-stream-based bulk-copy implementation, used to write into the target table (BulkInsertwithoutReturnIdentity) and into the pseudo (staging) table backing the other operations. It formats each row as a tab-delimited, newline-terminated record (backslash-escaping literal backslashes/tabs/CR/LF), with Postgres-lineaget/fboolean literals and hex-encoded binary values, and runs synchronously on the calling thread — the async overloads offload that synchronous sequence to a background thread instead, sinceVerticaCopyStreamexposes no async API of its own. VerticaBulkImportIdentityBehavior(KeepIdentitydefault,ReturnIdentity) — controls whether identity values are sent as-is or read back.ReturnIdentityreads generated values back via a singleSELECT LAST_INSERT_ID(), back-computing every row’s individual identity from Vertica’s contiguous, insertion-orderedIDENTITY/AUTO_INCREMENTassignment — no per-row round trip needed.VerticaBulkImportPseudoTableType(Auto,Memory,Physical) — selects the staging-table strategy backingBulkMerge,BulkUpdate,BulkDelete,BulkDeleteByKey, andBulkInsert(whenReturnIdentityis used). Every staging table is created with a per-call unique name, soMemoryandPhysicalare both genuinely functional and safe under concurrent callers writing against the same target table.- VerticaBulkInsertMapItem — explicit source-to-destination column mapping. Its optional
VerticaTypeoverride is not currently consumed by theCOPY-based implementation (Vertica’sCOPYparser infers wire format from the destination column’s own server-side type) — kept only as a forward-looking escape hatch, matching every other bulk-operations package’s map-item shape. - VerticaTraceKeys — the tracing key constants for the five bulk operations, for use with ITrace.
BulkMergenever generates a nativeMERGEstatement (Vertica rejects it outright against a table with anIDENTITY/AUTO_INCREMENTcolumn) — it always issues a separateUPDATE ... FROMfollowed by a separateINSERT ... WHERE NOT EXISTS (...), as two distinct round trips rather than one compound statement. See BulkMerge for the full mechanics.
Known limitations (v1)
BulkCopyTimeoutis accepted on every operation for signature symmetry with the other providers’ bulk-operations packages, butVerticaCopyStreamhas no timeout-equivalent property to apply it to — the argument currently has no effect.- Identity read-back (for both
BulkInsertandBulkMerge) relies onVerticaDbHelper.GetScopeIdentity’sSELECT LAST_INSERT_ID()query plus a descending-offset back-computation that assumes Vertica assignsIDENTITY/AUTO_INCREMENTvalues strictly contiguously in insertion order. Neither the underlying query nor this assumption has been verified against a live Vertica instance; verify carefully under concurrent writers before relying on it in production. - The
DbDataReaderoverloads ofBulkInsertandBulkMergehave noidentityBehaviorargument — a forward-only, single-pass reader cannot be rewound to correlate generated identity values back onto a source row. BulkUpdate(and the update half ofBulkMerge) skip the generatedUPDATEstatement entirely when every staged field is also a qualifier (i.e. there is nothing left to actually update).- The synchronous
WriteToServer/Executepath is not thread-safe for concurrent use against the same connection — the pseudo table is created, indexed, read from, and dropped via other statements against that same connection immediately before/after the copy, so the copy itself must run on whatever thread is already driving that sequence. The async overloads offload to a background thread only because nothing else touches the connection concurrently while they await. - Every bulk call against a table it hasn’t seen before creates its own uniquely-named staging table (
CREATE TABLE/CREATE GLOBAL TEMPORARY TABLE) and drops it once the call completes, rather than creating one per (table, pseudo table type) and reusing it across calls the way the Oracle bulk package does. This package inherits every Known limitation of RepoDb.Vertica itself (e.g. no table hints,
MaxParameterCountof1500, the unverifiedMerge/MergeAllcompound-statement behavior).- Referenced the
RepoDbpackagev1.16.0. - Referenced the
RepoDb.Verticapackagev0.0.1-alpha. - Referenced the
Vertica.Datapackagev24.3.0.