Skip to content

Commit

Permalink
Merge pull request #855 from typelevel/set-constraints
Browse files Browse the repository at this point in the history
completion for `set constraints`
  • Loading branch information
tpolecat authored Apr 26, 2023
2 parents d43df5c + a680c60 commit be3b06c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/core/shared/src/main/scala/data/Completion.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ object Completion {
case object CreateTrigger extends Completion
case object AlterTrigger extends Completion
case object DropTrigger extends Completion
case object SetConstraints extends Completion
// more ...

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ object CommandComplete {
case Patterns.Update(s) => apply(Completion.Update(s.toInt))
case Patterns.Insert(s) => apply(Completion.Insert(s.drop(2).toInt))
case Patterns.Copy(s) => apply(Completion.Copy(s.toInt))
case "SET CONSTRAINTS" => apply(Completion.SetConstraints)
// more .. fill in as we hit them

case s => apply(Completion.Unknown(s))
Expand Down
9 changes: 9 additions & 0 deletions modules/tests/shared/src/test/scala/CommandTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,15 @@ class CommandTest extends SkunkTest {
} yield "ok"
}

sessionTest("set constraints") { s =>
s.transaction.use { _ =>
for {
c <- s.execute(sql"set constraints all deferred".command)
_ <- assert("completion", c == Completion.SetConstraints)
} yield "ok"
} >> s.assertHealthy
}

sessionTest("insert, update and delete record") { s =>
for {
c <- s.execute(insertCity, Garin)
Expand Down

0 comments on commit be3b06c

Please sign in to comment.