Frequently Asked Questions
Q: Squash is same as Exposed. Where is the difference?
A: Ilya Ryzhenkov (Squash maintainer) answers:
Q: Can I use multiple Database Connections?
A: Yes. See Transactions
Q: Is Array
column type supported?
A: Yes. See Data Types.
Q: Is upsert
supported?
A: Yes. See Insert Or Update
Q: Is json
type supported?
A: Yes. See JSON
Q: How to get a plain SQL query which will be executed?
A:
Use QueryBuiler with false
- if you want to inline statement arguments, true
- to see '?' in query.
Q: Is it possible to use native sql / sql as a string?
A: It is not supported as part of the library, but it is possible to implement on top of it and use it like this:
More info in this issue: https://github.com/JetBrains/Exposed/issues/118
Q: Is it possible to update a field relative to current field value?
A: Yes. See example here: https://github.com/JetBrains/Exposed/wiki/DSL#update
Q: How can I add another type of Database?
A: Implement DatabaseDialect
interface and register it with Database.registerDialect()
.
If the implementation adds a lot of value consider contributing it as a PR to Exposed.
Q: Is it possible to create tables with cross / cyclic reference?
A: Yes, it's possible since Exposed 0.11.1 version
Q: How can I implement nested queries?
A: See example here: https://github.com/JetBrains/Exposed/issues/248
Q: How can I use SAVEPOINT?
A: It possible only through using a raw connection. See example here.
Q: How to prepare query like: SELECT * FROM table WHERE (x,y) IN ((1, 2), (3, 4), (5, 6))
A: It possible with custom function. See example.
Q: Where can I find snapshot builds of Exposed
A: You could use jitpack.io service for that.
Add jitpack.io to repositories:
Then add Exposed dependency as stated below:
Q: How can I create a custom column type?
A: Just implements IColumnType and use registerColumn to extends a Table
eg: Create custom UUID types (inpired by @pjagielski article)
Reference: #149