Skip to content

Instantly share code, notes, and snippets.

View jordanburke's full-sized avatar

Jordan jordanburke

  • Helio Health Group
  • Boston, Massachusetts
  • 17:29 (UTC -04:00)
  • LinkedIn in/jordanhburke
View GitHub Profile
@jordanburke
jordanburke / SquerylSQL.scala
Last active August 29, 2015 13:56 — forked from max-l/squeryl hand written SQL
squeryl hand written SQL
import RawSql._
val pathsById = q("select id, st_AsText(r.path) from findPaths(?,?,?)", x, y, z).toSeq[Long, String].toMap
object object RawSql {
def q(query: String, args: Any*) =
new RawTupleQuery(query, args)
class RawTupleQuery(query: String, args: Seq[Any]) {
/**
The MIT License (MIT)
Copyright (c) 2013 Jean Helou
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
trait XsnTypeMode extends PrimitiveTypeMode {
import com.codahale.jerkson.Json._
import scala.collection.mutable.HashMap
import scala.language.implicitConversions
implicit val jsonTEF = new NonPrimitiveJdbcMapper[String,HashMap[String, Any],TString](stringTEF, this) {
def convertFromJdbc(v: String) = if(v == null) null else parse[HashMap[String, Any]](v)
def convertToJdbc(v: HashMap[String, Any]) = if(v == null) null else generate(v)
override def sample = new HashMap[String, Any]()
}