This commit is contained in:
Jabberwocky238
2026-07-15 11:51:31 -04:00
parent c746f88bbe
commit a0fe361c1f
2 changed files with 3 additions and 70 deletions
-20
View File
@@ -92,18 +92,6 @@ func init() {
sql.Register(sqliteDriver, &sqlite.Driver{})
}
// Open parses a database URI, opens a migrated xorm engine, and returns it.
// For SQLite it also creates the parent directory and pins the pool to a single
// connection (SQLite serializes writes through one global lock; busy_timeout
// covers cross-process contention).
// func Open(root string, uri string) (*LocalState, error) {
// driver, dsn, _, err := common.ParseDBURI(root, uri)
// if err != nil {
// return nil, err
// }
// return OpenWithDSN(root, driver, dsn)
// }
func OpenWithDSN(root string, driver string, dsn string) (*LocalState, error) {
engine, err := InitEngine(driver, dsn)
if err != nil {
@@ -118,14 +106,6 @@ func OpenWithDSN(root string, driver string, dsn string) (*LocalState, error) {
}, nil
}
// OpenSkipAuth returns a LocalState that bypasses the DB entirely: access
// checks always pass, RepoPath resolves any path under root. For zero-config
// local dev (-skip-auth); no DB URI needed. The host key is still loaded/created
// on disk so SSH works.
func OpenSkipAuth(root string) *LocalState {
return &LocalState{root: root, skipAuth: true}
}
// Signer returns the SSH host key, creating and persisting it on first use.
// Cached so the key is stable for the process lifetime.
func (s *LocalState) Signers() ([]ssh.Signer, error) {