API 레퍼런스는 소스 코드의 Go 문서 주석에서 추출되며 영어로 작성되어 있습니다.
package sqlitestore
import "github.com/nsgo-dev/game/pkg/online/leaderboard/selfhost/sqlitestore"개요
Package sqlitestore is experimental: its API and documented formats may change in a minor release. See the API stability policy. keeps the self-hosted leaderboard's records in an SQLite file through the pure Go modernc.org/sqlite driver.
색인
함수
func Open(ctx context.Context, path string) (*sqlstore.Store, error)Open opens or creates the SQLite database at path (":memory:" for one in memory) in write-ahead-log mode, migrates its leaderboard schema and returns a store over it. A path containing ? or # is refused.
func OpenReader(ctx context.Context, path string) (*sql.DB, error)OpenReader opens a second handle on the SQLite database file at path, which Open has already opened, for work that must not queue behind the store's single connection: a service's readiness check and the counts its metrics scan. Its connections only read (query_only), and the database's write-ahead log lets them read while the store writes, so neither a long write delays them nor a full-table count delays the store. It refuses ":memory:", a database only the store's own connection sees. Close the handle when the service stops.