Skip to content

Commit 1a4b4a4

Browse files
committed
Initial commit
This commit contains the initial logic for running an fsm using postgres as the underlying store. Signed-off-by: David Bond <[email protected]>
0 parents  commit 1a4b4a4

File tree

13 files changed

+761
-0
lines changed

13 files changed

+761
-0
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: gomod
5+
directory: /
6+
schedule:
7+
interval: daily
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: daily

.github/workflows/go.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: go
2+
3+
concurrency:
4+
group: ${{ github.workflow }}/${{ github.ref_name }}
5+
6+
on:
7+
push:
8+
paths:
9+
- '**.go'
10+
- '**.sql'
11+
- '**.mod'
12+
- '**.sum'
13+
- '.github/workflows/go.yml'
14+
branches:
15+
- main
16+
pull_request:
17+
paths:
18+
- '**.go'
19+
- '**.sql'
20+
- '**.mod'
21+
- '**.sum'
22+
- '.github/workflows/go.yml'
23+
24+
jobs:
25+
test:
26+
runs-on: ubuntu-latest
27+
28+
services:
29+
postgres:
30+
image: postgres
31+
env:
32+
POSTGRES_PASSWORD: postgres
33+
ports:
34+
- 5432:5432
35+
options: >-
36+
--health-cmd pg_isready
37+
--health-interval 10s
38+
--health-timeout 5s
39+
--health-retries 5
40+
41+
steps:
42+
- name: Checkout
43+
uses: actions/[email protected]
44+
45+
- name: Install Go
46+
uses: actions/setup-go@v5
47+
with:
48+
go-version-file: go.mod
49+
cache: true
50+
51+
- name: Run tests
52+
run: make test

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 David Bond
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
migrate:
2+
go tool migrate create -dir migrations -ext sql $(name)
3+
4+
test:
5+
go test -race ./...

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# pgfsm
2+
3+
[![Go Reference](https://pkg.go.dev/badge/github.com/davidsbond/pgfsm.svg)](https://pkg.go.dev/github.com/davidsbond/pgfsm) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![CI](https://github.com/davidsbond/pgfsm/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/davidsbond/pgfsm/actions/workflows/go.yml)
4+
5+
A Go package for building finite-state machines using PostgreSQL.

database.go

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
package pgfsm
2+
3+
import (
4+
"context"
5+
"database/sql"
6+
"embed"
7+
"errors"
8+
"fmt"
9+
10+
"github.com/golang-migrate/migrate/v4"
11+
mpq "github.com/golang-migrate/migrate/v4/database/postgres"
12+
"github.com/golang-migrate/migrate/v4/source/iofs"
13+
)
14+
15+
var (
16+
//go:embed migrations/*.sql
17+
migrations embed.FS
18+
)
19+
20+
func transaction(ctx context.Context, db *sql.DB, fn func(ctx context.Context, tx *sql.Tx) error) error {
21+
tx, err := db.BeginTx(ctx, &sql.TxOptions{})
22+
if err != nil {
23+
return err
24+
}
25+
26+
if err = fn(ctx, tx); err != nil {
27+
txErr := tx.Rollback()
28+
if errors.Is(txErr, sql.ErrTxDone) {
29+
return err
30+
}
31+
32+
return errors.Join(err, txErr)
33+
}
34+
35+
err = tx.Commit()
36+
if errors.Is(err, sql.ErrTxDone) {
37+
return nil
38+
}
39+
40+
return err
41+
}
42+
43+
func insert(ctx context.Context, tx *sql.Tx, encoder Encoding, cmd Command) error {
44+
data, err := encoder.Encode(cmd)
45+
if err != nil {
46+
return err
47+
}
48+
49+
const q = `INSERT INTO pgfsm_command (kind, data) VALUES ($1, $2)`
50+
51+
_, err = tx.ExecContext(ctx, q, cmd.Kind(), data)
52+
return err
53+
}
54+
55+
func next(ctx context.Context, tx *sql.Tx) (int64, string, []byte, error) {
56+
const q = `
57+
SELECT id, kind, data FROM pgfsm_command
58+
ORDER BY id ASC
59+
FOR UPDATE SKIP LOCKED
60+
LIMIT 1
61+
`
62+
63+
var (
64+
id int64
65+
kind string
66+
data []byte
67+
)
68+
69+
if err := tx.QueryRowContext(ctx, q).Scan(&id, &kind, &data); err != nil {
70+
return 0, "", []byte{}, err
71+
}
72+
73+
return id, kind, data, nil
74+
}
75+
76+
func remove(ctx context.Context, tx *sql.Tx, id int64) error {
77+
const q = `DELETE FROM pgfsm_command WHERE id = $1`
78+
79+
_, err := tx.ExecContext(ctx, q, id)
80+
return err
81+
}
82+
83+
func migrateUp(db *sql.DB) error {
84+
source, err := iofs.New(migrations, "migrations")
85+
if err != nil {
86+
fmt.Println("source", err)
87+
return err
88+
}
89+
90+
const (
91+
migrationsTable = "pgfsm_migration"
92+
)
93+
94+
destination, err := mpq.WithInstance(db, &mpq.Config{
95+
MigrationsTable: migrationsTable,
96+
})
97+
if err != nil {
98+
fmt.Println("dest", err)
99+
return err
100+
}
101+
102+
migration, err := migrate.NewWithInstance("iofs", source, "pgx", destination)
103+
if err != nil {
104+
fmt.Println("instance", err)
105+
return err
106+
}
107+
108+
err = migration.Up()
109+
switch {
110+
case errors.Is(err, migrate.ErrNoChange):
111+
return nil
112+
case err != nil:
113+
fmt.Println("up", err)
114+
return err
115+
default:
116+
return nil
117+
}
118+
}

encoding.go

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package pgfsm
2+
3+
import (
4+
"bytes"
5+
"encoding/gob"
6+
"encoding/json"
7+
)
8+
9+
type (
10+
// The Encoding interface is used to convert Command implementations to and from their byte representation that is
11+
// stored by the FSM within the database.
12+
Encoding interface {
13+
// Encode the value provided, returning its byte representation.
14+
Encode(any) ([]byte, error)
15+
// Decode the bytes provided into their literal type.
16+
Decode([]byte, any) error
17+
}
18+
19+
// The JSON type is an Encoding implementation that will encode/decode Command implementations into their json
20+
// representation using encoding/json.
21+
JSON struct{}
22+
23+
// The GOB type is an Encoding implementation that will encode/decode Command implementations into their gob
24+
// representation using encoding/gob.
25+
GOB struct{}
26+
)
27+
28+
func (j *JSON) Encode(v interface{}) ([]byte, error) {
29+
return json.Marshal(v)
30+
}
31+
32+
func (j *JSON) Decode(data []byte, v interface{}) error {
33+
return json.Unmarshal(data, v)
34+
}
35+
36+
func (g *GOB) Encode(v any) ([]byte, error) {
37+
buffer := new(bytes.Buffer)
38+
err := gob.NewEncoder(buffer).Encode(v)
39+
return buffer.Bytes(), err
40+
}
41+
42+
func (g *GOB) Decode(data []byte, v interface{}) error {
43+
buffer := bytes.NewBuffer(data)
44+
return gob.NewDecoder(buffer).Decode(v)
45+
}

go.mod

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module github.com/davidsbond/pgfsm
2+
3+
go 1.24.0
4+
5+
require (
6+
github.com/golang-migrate/migrate/v4 v4.18.2
7+
github.com/lib/pq v1.10.9
8+
github.com/stretchr/testify v1.10.0
9+
golang.org/x/sync v0.11.0
10+
)
11+
12+
require (
13+
github.com/davecgh/go-spew v1.1.1 // indirect
14+
github.com/hashicorp/errwrap v1.1.0 // indirect
15+
github.com/hashicorp/go-multierror v1.1.1 // indirect
16+
github.com/kr/pretty v0.3.1 // indirect
17+
github.com/pmezard/go-difflib v1.0.0 // indirect
18+
github.com/rogpeppe/go-internal v1.13.1 // indirect
19+
go.opentelemetry.io/otel/metric v1.34.0 // indirect
20+
go.opentelemetry.io/otel/trace v1.34.0 // indirect
21+
go.uber.org/atomic v1.7.0 // indirect
22+
golang.org/x/sys v0.29.0 // indirect
23+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
24+
gopkg.in/yaml.v3 v3.0.1 // indirect
25+
)

go.sum

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
2+
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
3+
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
4+
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
5+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
6+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
8+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
9+
github.com/dhui/dktest v0.4.4 h1:+I4s6JRE1yGuqflzwqG+aIaMdgXIorCf5P98JnaAWa8=
10+
github.com/dhui/dktest v0.4.4/go.mod h1:4+22R4lgsdAXrDyaH4Nqx2JEz2hLp49MqQmm9HLCQhM=
11+
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
12+
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
13+
github.com/docker/docker v27.2.0+incompatible h1:Rk9nIVdfH3+Vz4cyI/uhbINhEZ/oLmc+CBXmH6fbNk4=
14+
github.com/docker/docker v27.2.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
15+
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
16+
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
17+
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
18+
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
19+
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
20+
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
21+
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
22+
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
23+
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
24+
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
25+
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
26+
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
27+
github.com/golang-migrate/migrate/v4 v4.18.2 h1:2VSCMz7x7mjyTXx3m2zPokOY82LTRgxK1yQYKo6wWQ8=
28+
github.com/golang-migrate/migrate/v4 v4.18.2/go.mod h1:2CM6tJvn2kqPXwnXO/d3rAQYiyoIm180VsO8PRX6Rpk=
29+
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
30+
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
31+
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
32+
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
33+
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
34+
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
35+
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
36+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
37+
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
38+
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
39+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
40+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
41+
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
42+
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
43+
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
44+
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
45+
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
46+
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
47+
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
48+
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
49+
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
50+
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
51+
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
52+
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
53+
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
54+
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
55+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
56+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
57+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
58+
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
59+
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
60+
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
61+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
62+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
63+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
64+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
65+
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
66+
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
67+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk=
68+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8=
69+
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
70+
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
71+
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
72+
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
73+
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
74+
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
75+
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
76+
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
77+
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
78+
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
79+
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
80+
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
81+
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
82+
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
83+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
84+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
85+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
86+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
87+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
BEGIN;
2+
3+
DROP TABLE IF EXISTS command;
4+
5+
COMMIT;

0 commit comments

Comments
 (0)