fw-ai/postgres
forked from go-gorm/postgres
Captured source
source ↗published Jun 23, 2023seen 5dcaptured 8hhttp 200method plain
fw-ai/postgres
Description: GORM PostgreSQL driver
Language: Go
License: MIT
Stars: 0
Forks: 0
Open issues: 1
Created: 2023-06-23T23:24:44Z
Pushed: 2026-05-20T04:15:40Z
Default branch: master
Fork: yes
Parent repository: go-gorm/postgres
Archived: no
README:
GORM PostgreSQL Driver
Quick Start
import (
"gorm.io/driver/postgres"
"gorm.io/gorm"
)
// https://github.com/jackc/pgx
dsn := "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai"
db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})Configuration
import (
"gorm.io/driver/postgres"
"gorm.io/gorm"
)
db, err := gorm.Open(postgres.New(postgres.Config{
DSN: "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai", // data source name, refer https://github.com/jackc/pgx
PreferSimpleProtocol: true, // disables implicit prepared statement usage. By default pgx automatically uses the extended protocol
}), &gorm.Config{})Checkout https://gorm.io for details.