-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconstructors.go
More file actions
24 lines (20 loc) · 851 Bytes
/
Copy pathconstructors.go
File metadata and controls
24 lines (20 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package sql
import (
"context"
"database/sql"
)
// NewSQLiteCheckpointer creates a SQLite-based checkpointer.
func NewSQLiteCheckpointer(ctx context.Context, db *sql.DB, opts ...Option) (*Checkpointer, error) {
opts = append(opts, WithDialect(&SQLiteDialect{}))
return NewCheckpointer(ctx, db, opts...)
}
// NewPostgreSQLCheckpointer creates a PostgreSQL-based checkpointer.
func NewPostgreSQLCheckpointer(ctx context.Context, db *sql.DB, opts ...Option) (*Checkpointer, error) {
opts = append(opts, WithDialect(&PostgreSQLDialect{}))
return NewCheckpointer(ctx, db, opts...)
}
// NewMySQLCheckpointer creates a MySQL/MariaDB-based checkpointer.
func NewMySQLCheckpointer(ctx context.Context, db *sql.DB, opts ...Option) (*Checkpointer, error) {
opts = append(opts, WithDialect(&MySQLDialect{}))
return NewCheckpointer(ctx, db, opts...)
}