https://kotlinlang.org logo
#exposed
Title
# exposed
s

SrSouza

09/12/2019, 12:01 PM
Hi @tapacin the future we will be able to create your own ColumnType?
t

tapac

09/12/2019, 12:06 PM
What is preventing you from doing it right now?
s

SrSouza

09/12/2019, 12:12 PM
right now, basically all implementation of ColumnTypes class is final (in my case, I want to work with a Blob)
t

tapac

09/12/2019, 12:13 PM
You could delegate to a BlobColumnType:
Copy code
class MyBlobColumnType : IColumnType by BlobColumnType() {
    
}
❤️ 1
t

tapac

09/12/2019, 12:20 PM
There is
ColumnWithTransform
which accepts two lambdas to convert values to and from a database. Like:
Copy code
class FooEntity() : IntEntity {

   var offlinePlayer = FooTable.playerId.transform({ it.uniqueId }, { offlinePlayer(it) })
}
s

SrSouza

09/12/2019, 12:22 PM
I was think in ask exactly about it, this is a better approach than mine, tkx again
t

tapac

09/12/2019, 12:23 PM
The main problem is the lack of documentation, but we plan to improve it in the near future.
3 Views