MCPcopy Create free account
hub / github.com/upper/db / Test_Issue210

Method Test_Issue210

adapter/postgresql/postgresql_test.go:1202–1236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1200}
1201
1202func (s *AdapterTests) Test_Issue210() {
1203 list := []string{
1204 `DROP TABLE IF EXISTS testing123`,
1205 `DROP TABLE IF EXISTS hello`,
1206 `CREATE TABLE IF NOT EXISTS testing123 (
1207 ID INT PRIMARY KEY NOT NULL,
1208 NAME TEXT NOT NULL
1209 )
1210 `,
1211 `CREATE TABLE IF NOT EXISTS hello (
1212 ID INT PRIMARY KEY NOT NULL,
1213 NAME TEXT NOT NULL
1214 )`,
1215 }
1216
1217 sess := s.Session()
1218
1219 err := sess.Tx(func(tx db.Session) error {
1220 for i := range list {
1221 _, err := tx.SQL().Exec(list[i])
1222 s.NoError(err)
1223 if err != nil {
1224 return err
1225 }
1226 }
1227 return nil
1228 })
1229 s.NoError(err)
1230
1231 _, err = sess.Collection("testing123").Find().Count()
1232 s.NoError(err)
1233
1234 _, err = sess.Collection("hello").Find().Count()
1235 s.NoError(err)
1236}
1237
1238func (s *AdapterTests) TestPreparedStatements() {
1239 sess := s.Session()

Callers

nothing calls this directly

Calls 7

SessionMethod · 0.65
TxMethod · 0.65
ExecMethod · 0.65
SQLMethod · 0.65
CountMethod · 0.65
FindMethod · 0.65
CollectionMethod · 0.65

Tested by

no test coverage detected