Install-Module cbsch-pgsql -Scope CurrentUser
$credential = Get-Credential
$connection = Connect-PgSql -Credential $credential
Invoke-PgSql -Connection $connection -Query @"
CREATE TABLE test(
id int,
guid uuid,
date timestamp with time zone,
smallint integer,
bigint bigint,
double double precision
)
"@
Invoke-PgSql -Connection $connection -Query @"
INSERT INTO test(id, guid, date, smallint, bigint, double)
VALUES(@id, @guid, @date, @smallint, @bigint, @double)
"@ -Parameters @{
"@id" = 1
"@guid" = [Guid]::NewGuid()
"@date" = Get-Date
"@smallint" = 42
"@bigint" = [Int64]::MaxValue
"@double" = 0.23
}
Invoke-PgSql -Connection $connection -Query "SELECT * FROM test"
-
Notifications
You must be signed in to change notification settings - Fork 1
License
cbsch/cbsch-pgsql
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published