MCPcopy Create free account
hub / github.com/InferCore/InferCore / migrateSQLiteLedger

Function migrateSQLiteLedger

internal/requests/sqlite.go:79–89  ·  view source on GitHub ↗
(db *sql.DB)

Source from the content-addressed store, hash-verified

77}
78
79func migrateSQLiteLedger(db *sql.DB) error {
80 _, err := db.Exec(`ALTER TABLE requests ADD COLUMN ai_request_json TEXT`)
81 if err == nil {
82 return nil
83 }
84 msg := strings.ToLower(err.Error())
85 if strings.Contains(msg, "duplicate column") {
86 return nil
87 }
88 return fmt.Errorf("sqlite migrate ai_request_json: %w", err)
89}
90
91func (s *sqliteStore) CreateRequest(ctx context.Context, row RequestRow) error {
92 _, err := s.db.ExecContext(ctx, `

Callers 1

NewSQLiteStoreFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected