feat(files): SQL file backend via Client.FileStore/SQLFileStore + live MySQL integration (#55)
Release Please / Release Please (push) Skipped
Release / GoReleaser (push) Skipped
Tests / Secret scan (gitleaks) (push) Skipped
Tests / Test (Go 1.25) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Tests / Secret scan (gitleaks) (pull_request) Successful in 4s
Tests / Test (Go stable) (pull_request) Successful in 24s
Tests / Test (Go 1.25) (pull_request) Successful in 26s
Release Please / Release Please (push) Skipped
Release / GoReleaser (push) Skipped
Tests / Secret scan (gitleaks) (push) Skipped
Tests / Test (Go 1.25) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Tests / Secret scan (gitleaks) (pull_request) Successful in 4s
Tests / Test (Go stable) (pull_request) Successful in 24s
Tests / Test (Go 1.25) (pull_request) Successful in 26s
This commit is contained in:
@@ -90,6 +90,15 @@ func pgDSNFromParts() string {
|
||||
host, port, os.Getenv("ONLYOFFICE_PG_USER"), os.Getenv("ONLYOFFICE_PG_PASSWORD"), dbname, sslmode)
|
||||
}
|
||||
|
||||
// SQLFileStore opens the read-only SQL store from the environment
|
||||
// (PGConfigFromEnv: ONLYOFFICE_DSN or the ONLYOFFICE_PG_* parts). It is the
|
||||
// error-aware counterpart of Client.FileStore("pg"/"sql"), which returns an
|
||||
// errStore when the open fails. The caller owns the returned store and should
|
||||
// close it (the concrete type has a Close method).
|
||||
func (c *Client) SQLFileStore() (FileStore, error) {
|
||||
return NewPGStore(PGConfigFromEnv())
|
||||
}
|
||||
|
||||
// pgStore is a read-only FileStore/Searcher over the Community Server database.
|
||||
type pgStore struct {
|
||||
db *sql.DB
|
||||
|
||||
Reference in New Issue
Block a user