Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions SqlPipeline/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Initialize-SQLPipeline -DbPath '.\pipeline.db'

Import-Csv '.\orders.csv' | Add-RowsToDuckDB -TableName 'orders' -PKColumns 'order_id' -UseTransaction -Verbose

Close-DuckDBConnection
Close-SqlPipeline
```

## Public Functions
Expand Down Expand Up @@ -195,16 +195,16 @@ Export-DuckDBToParquet -TableName 'orders' -OutputPath '.\export\orders.parquet'

---

### `Close-DuckDBConnection`
### `Close-SqlPipeline`

Closes a DuckDB connection cleanly. Use this when working with file-based databases opened via `Initialize-SQLPipeline`.

```PowerShell
# Close an explicit connection
Close-DuckDBConnection -Connection $conn
Close-SqlPipeline -Connection $conn

# Close the default connection
Close-DuckDBConnection -Connection (Initialize-SQLPipeline -DbPath '.\pipeline.db')
Close-SqlPipeline
```

| Parameter | Type | Description |
Expand Down Expand Up @@ -236,7 +236,7 @@ Set-LoadMetadata -TableName 'contacts' -RowsLoaded $contacts.items.Count
# Export for downstream consumption
Export-DuckDBToParquet -TableName 'contacts' -OutputPath '.\export\contacts.parquet'

Close-DuckDBConnection
Close-SqlPipeline
```

# SimplySQL Integration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Close-DuckDBConnection {
function Close-SqlPipeline {
<#
.SYNOPSIS
Closes a DuckDB connection cleanly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ function Initialize-SQLPipeline {
# File-based database
Initialize-SQLPipeline -DbPath '.\pipeline.db'
Import-Csv '.\orders.csv' | Add-RowsToDuckDB -TableName 'orders'
Close-DuckDBConnection
Close-SqlPipeline

.EXAMPLE
# Capture connection for explicit use
$conn = Initialize-SQLPipeline -DbPath '.\pipeline.db'
Import-Csv '.\orders.csv' | Add-RowsToDuckDB -Connection $conn -TableName 'orders'
Close-DuckDBConnection -Connection $conn
Close-SqlPipeline -Connection $conn
#>
[CmdletBinding()]
[OutputType([DuckDB.NET.Data.DuckDBConnection])]
Expand Down
5 changes: 3 additions & 2 deletions SqlPipeline/SqlPipeline/SqlPipeline.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
RootModule = 'SqlPipeline.psm1'

# Die Versionsnummer dieses Moduls
ModuleVersion = '0.3.1'
ModuleVersion = '0.3.2'

# Unterstützte PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -76,7 +76,7 @@ FunctionsToExport = @(
"Invoke-IncrementalLoad"
"New-DuckDBConnection"
"Initialize-SQLPipeline"
"Close-DuckDBConnection"
"Close-SqlPipeline"
"Get-LastLoadTimeStamp"
"Get-DuckDBData"
"Invoke-DuckDBQuery"
Expand Down Expand Up @@ -124,6 +124,7 @@ PrivateData = @{

# 'ReleaseNotes' des Moduls
ReleaseNotes = '
0.3.2 Renaming Close-DuckDBConnection to Close-SqlPipeline to not clash with Close-DuckDBConnection of AptecoPSFramework (which is used for direct DuckDB connections outside of SqlPipeline)
0.3.1 Skipping comparison with complex datatypes with -SimpleTypesOnly for better import performance
Adding a csv importer to export big files first into a temporary file and directly import them via DuckDB into a staging table
Added quotations around column names for duckdb support
Expand Down