Skip to content

Instantly share code, notes, and snippets.

@thosakwe
Last active August 12, 2018 20:00
Show Gist options
  • Save thosakwe/e79f6025b9ff804f82c5674ba11f3af2 to your computer and use it in GitHub Desktop.
Save thosakwe/e79f6025b9ff804f82c5674ba11f3af2 to your computer and use it in GitHub Desktop.
SpartanDB
from users where {distinct username} select { username }
table users (id) {
id: Id
name: String
balance: Float
}
table todos (id) {
id: BigId
text: String
status: enum TodoStatus {
COMPLETE
INCOMPLETE
}
}
from users select {
id
username
password
salt
}
union {
users where { status = UserStatus.CONFIRMED },
users where { status = UserStatus.UNKNOWN }
}
let completedTodos = todos where { status = TodoStatus.COMPLETE };
from completedTodos select {
id
text
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment