Instantly share code, notes, and snippets.

View ProtoColumnType.kt
// Protocol Buffer (protobuf) V3 - Kotlin Exposed columnType
// Converts to and from jsonb fields in postgres.
class ProtoColumnType(val message: Message) : ColumnType() {
override fun sqlType() = "JSONB"
override fun valueFromDB(value: Any): Any {
if (value is PGobject) {
return JsonFormat.parser().ignoringUnknownFields().merge(value.value, message.toBuilder())
}
throw RuntimeException("Can't parse object: ${value}")
View ChildFirstClassLoader.java
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
public class ChildFirstClassLoader extends URLClassLoader {