在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:alanshaw/ipfs-ds-postgres开源软件地址:https://github.com/alanshaw/ipfs-ds-postgres开源编程语言:Go 100.0%开源软件介绍:ipfs-ds-postgres
Note: Currently implements Installgo get github.com/alanshaw/ipfs-ds-postgres UsageEnsure a database is created and a table exists that has the following structure (replacing CREATE TABLE IF NOT EXISTS table_name (key TEXT NOT NULL UNIQUE, data BYTEA) It's recommended to create a CREATE INDEX IF NOT EXISTS table_name_key_text_pattern_ops_idx ON table_name (key text_pattern_ops) Import and use in your application: package main
import (
"context"
pgds "github.com/alanshaw/ipfs-ds-postgres"
)
const (
connString = "postgresql://user:pass@host:12345/database?sslmode=require"
tableName = "blocks" // (default)
)
func main() {
ds, err := pgds.NewDatastore(context.Background(), connString, pgds.Table(tableName))
if err != nil {
panic(err)
}
} APIContributeFeel free to dive in! Open an issue or submit PRs. LicenseMIT © Alan Shaw |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论