Skip to content

Instantly share code, notes, and snippets.

View lukasjapan's full-sized avatar

Lukas lukasjapan

View GitHub Profile
@simg
simg / Node-pg Entity Relationship Benchmark.md
Last active September 30, 2019 05:18
Benchmarking the performance of creating entity relationships with Postgres Arrays compared to "join tables"

A very common pattern in relational databases is the use of a join table to create one-to-many or many-to-many relationships between entities.

eg, something like:

CREATE TABLE table1 ( 
  id serial PRIMARY KEY 
, acolumn character varying); 

CREATE TABLE table2 (

@udalov
udalov / getKType.kt
Last active March 16, 2021 21:54
DEPRECATED example how to obtain KType instance from reified T. Please use "typeOf" since 1.3.40!
import java.lang.reflect.*
import kotlin.reflect.KClass
import kotlin.reflect.KType
import kotlin.reflect.KTypeProjection
import kotlin.reflect.KVariance
import kotlin.reflect.full.createType
// --- Interface ---
inline fun <reified T : Any> getKType(): KType =