refactor(monorepo): extract coord-core

This commit is contained in:
2026-03-20 13:01:16 +08:00
parent 3cf7a15626
commit 1938eb8f07
65 changed files with 6586 additions and 85 deletions
+23
View File
@@ -0,0 +1,23 @@
package db
import (
"context"
"database/sql"
"fmt"
)
func applyPragmas(ctx context.Context, db *sql.DB) error {
pragmas := []string{
"PRAGMA foreign_keys = ON;",
"PRAGMA journal_mode = WAL;",
"PRAGMA busy_timeout = 5000;",
}
for _, pragma := range pragmas {
if _, err := db.ExecContext(ctx, pragma); err != nil {
return fmt.Errorf("apply pragma %q: %w", pragma, err)
}
}
return nil
}