go操作PostgreSQL示例代码

代码语言:golang

所属分类:其他

代码描述:go操作PostgreSQL示例代码

代码标签: 示例

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

package main

import (
    "database/sql"
    "fmt"

    _ "github.com/lib/pq"
)

const (
    host     = "localhost"
    port     = 5432
    user     = "postgres"
    password = "your_password"
    dbname   = "test"
)

func main() {
    psqlInfo := fmt.Sprintf("host=%s port=%d use.........完整代码请登录后点击上方下载按钮下载查看

网友评论0