{"modulePath":"github.com/worklydev/workly","version":"v0.5.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package postgres\n\nPackage postgres implements store.Store on PostgreSQL (14+).\n\nTo keep Workly's tables in a dedicated schema, create the schema and pass search\\_path in the connection URL, e.g. postgres://…/app?search\\_path=workly.\n\n## Types\n\n```go\ntype Store struct {\n\t*sqlstore.Store\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc Open(ctx context.Context, url string) (*Store, error)\n```\nOpen creates a connection pool. It does not connect until first use.\n\n```go\nfunc (s *Store) Close() error\n```\n\n```go\nfunc (s *Store) ListenChanges(ctx context.Context, ready func(), fn func([]workspace.ID)) error\n```\nListenChanges listens on a connection of its own, taken out of the pool: a pooled connection would carry the LISTEN to whoever uses it next.\n\n```go\nfunc (s *Store) Migrate(ctx context.Context) error\n```\n\n```go\nfunc (s *Store) MigrationsPending(ctx context.Context) (bool, error)\n```\n\n```go\nfunc (s *Store) Ping(ctx context.Context) error\n```\n\n```go\nfunc (s *Store) PublishChanges(ctx context.Context, ws []workspace.ID) error\n```\n\n```go\nfunc (s *Store) TryLead(ctx context.Context) (store.Leader, error)\n```\nTryLead takes the leader advisory lock on a dedicated connection, which also LISTENs for enqueue notifications. If the process dies the connection drops, Postgres releases the lock and another replica takes over.\n\n","path":"github.com/worklydev/workly/internal/store/postgres","name":"postgres","synopsis":"Package postgres implements store.Store on PostgreSQL (14+).","isRedistributable":true}
