pg-lockless-fifo-demo defaults to sqlite

main
Bel LaPointe 2025-12-11 10:11:48 -07:00
parent 352d8e1fbc
commit 3f69a2d5d5
1 changed files with 3 additions and 6 deletions

View File

@ -9,9 +9,6 @@ import (
"time"
"pg/src/with"
_ "github.com/lib/pq"
_ "modernc.org/sqlite"
)
func main() {
@ -22,14 +19,14 @@ func main() {
func run(ctx context.Context) error {
fs := flag.NewFlagSet(os.Args[0], flag.ContinueOnError)
c := fs.String("c", "postgresql://pulsegres:pulsegres@localhost:15432", "conn string")
c := fs.String("c", "sqlite://", "conn string")
if err := fs.Parse(os.Args[1:]); err != nil {
panic(err)
}
return with.PSQL(ctx, *c, func(pg *sql.DB) error {
return with.SQL(ctx, *c, func(db *sql.DB) error {
go with.Every(ctx, 5*time.Second, func() {
row := pg.QueryRowContext(ctx, `SELECT 1`)
row := db.QueryRowContext(ctx, `SELECT 1`)
var n int
if err := row.Err(); err != nil {
log.Println("query err:", err)