GitHubLoslegen

Die API-Referenz stammt aus den Go-Doc-Kommentaren im Quellcode und ist auf Englisch verfasst.

package sqlitestore

import "github.com/nsgo-dev/game/pkg/online/cloudsave/sqlitestore"

Nur auf linux, macos, windows, android, ios

Übersicht

Package sqlitestore opens a cloudsave.Store in a SQLite database file, with the pure-Go modernc.org/sqlite driver (no cgo). It suits a single cloud save service process; several processes sharing one database should use Postgres (package pgstore).

The package builds for every target but the web: a browser has no file system to keep the database in, and the cloud save service runs on a server.

Index

Funktionen

func Open(ctx context.Context, path string) (*sqlstore.Store, error)

Open opens (creating when missing) the SQLite database at path, or a private in-memory database for ":memory:", and returns a store on it with the schema created. The database uses write-ahead logging and waits up to five seconds for a lock another process holds.

The store uses one connection with immediate transactions, so its writes run one at a time. It suits a single service process; several processes sharing one database should use Postgres.