Docs
duckdb/replace.sql
replace.sql — delete all rows then re-insert the full staging set (no versioning).
replace.sql — delete all rows then re-insert the full staging set (no versioning).
Context fields
.HistorySchema.HistoryTable.StagingSchema.StagingTable
Template
{{- /* replace.sql — delete all rows then re-insert the full staging set (no versioning). */ -}}
{{- /* DELETE FROM rather than TRUNCATE: proven legacy behavior, and both statements run */ -}}
{{- /* in ONE transaction (rdbms.ExecStatements), so a failed re-insert rolls the delete */ -}}
{{- /* back. */ -}}
DELETE FROM "{{ .HistorySchema }}"."{{ .HistoryTable }}";
INSERT INTO "{{ .HistorySchema }}"."{{ .HistoryTable }}" (
{{ template "business_col_list" . }}, {{ template "amf_system_cols" . }}
)
SELECT {{ template "business_col_list" . }}, {{ template "amf_system_vals" . }}
FROM "{{ .StagingSchema }}"."{{ .StagingTable }}" stgProvenance
| Platform | duckdb |
| File | duckdb/replace.sql |
| Version | v1.3.1 |
| Lines | 11 |
| SHA-256 | ad89b0ab4d1670889c014ae6add21693ef8f8e26831f4e8d1461884ebe82403d |
Last updated on October 11, 2026