This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git filter-branch --env-filter ' | |
OLD_EMAIL="[email protected]" | |
CORRECT_NAME="Alexander Ioffe" | |
CORRECT_EMAIL="[email protected]" | |
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] | |
then | |
export GIT_COMMITTER_NAME="$CORRECT_NAME" | |
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.getquill.context.orientdb | |
import io.getquill.{ Insert, Literal, OrientDBSyncContext } | |
import io.getquill.context.encoding.OptionalNestedSpec | |
import io.getquill.context.orientdb.orientdb.{ resetSchema, setup } | |
import org.scalatest.BeforeAndAfterAll | |
class OptionalProductEncodingJdbcSpec extends OptionalNestedSpec with BeforeAndAfterAll { | |
val context: OrientDBSyncContext[Literal.type] = orientdb.testSyncDB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Type Level | |
type U[M[_]] = M[Int] | |
type Bi[A, B] = Map[A, B] | |
type X[A] = U[[A] =>> Bi[String, A]] | |
implicitly[X[Int] =:= Bi[String,Int]] | |
// Result: =:=[X[Int], Map[String, Int]] | |
// Note that this is also true: implicitly[X[java.util.Date] =:= Bi[String,Int]] | |
// hence this example is not very good | |
// Value level |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This will download ammonite and put into /usr/local/bin. Command is `amm3`, if you already have `amm` it won't be affected | |
// sudo sh -c '(echo "#!/usr/bin/env sh" && curl -L https://github.com/com-lihaoyi/Ammonite/releases/download/2.5.2/3.1-2.5.2) > /usr/local/bin/amm3 && chmod +x /usr/local/bin/amm3' && amm3 | |
import $ivy.`io.getquill::quill-sql:3.16.3.Beta2.3` | |
// https://repo1.maven.org/maven2/io/getquill/quill-sql_3/3.16.3.Beta2.3/quill-sql_3-3.16.3.Beta2.3.pom... | |
// import $ivy.$ | |
import io.getquill._ | |
// import io.getquill._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.getquill.util | |
import io.getquill.AstPrinter | |
import fansi.Str | |
import io.getquill.ast.Renameable.{ ByStrategy, Fixed } | |
import io.getquill.ast.Visibility.{ Hidden, Visible } | |
import io.getquill.ast._ | |
import io.getquill.quat.Quat | |
import io.getquill.util.Messages.QuatTrace | |
import pprint.{ Renderer, Tree, Truncated } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Say we have something like this: | |
case class OperationsParser(root: Parser[Ast] = Parser.empty)(override implicit val qctx: Quotes) extends Parser.Clause[Ast] with ComparisonTechniques { | |
def delegate: PartialFunction[Expr[_], Ast] = { | |
case ... | |
} | |
} | |
// Just do this: | |
case class OperationsParser(root: Parser[Ast] = Parser.empty)(override implicit val qctx: Quotes) extends Parser.Clause[Ast] with ComparisonTechniques { | |
def delegate: PartialFunction[Expr[_], Ast] = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.getquill.context.sql | |
import java.time.LocalDate | |
import java.util.{ Date, UUID } | |
import io.getquill.context.Context | |
import io.getquill._ | |
//case class EncodingTestType(value: String) | |
case class Number(value: String) extends AnyVal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// It's a bit complex because if you throw an error you usually don't get the result | |
// i.e. the place where the decoder is summoned returns the error because no decoder can be summoned from there | |
// [error] -- Error: /Users/aleiof/git/dotty_test/quill-sql/src/test/scala/io/getquill/QueryTest.scala:31:26 | |
// [error] 31 | val result = ctx.run(q) | |
// [error] | ^^^^^^^^^^ | |
// [error] | Decoder could not be summoned during query execution | |
// if you use report.warning and return something you usually get it | |
def decode[T: Type, ResultRow: Type](index: Expr[Int], resultRow: Expr[ResultRow])(using Quotes): Expr[T] = { | |
import quotes.reflect._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I first found this in PeopleSpec that was being used by PeoplePostgresAsyncSpec | |
trait PeopleSpec extends Spec { | |
inline def peopleInsert = | |
quote((p: Person) => query[Person].insert(p)) | |
inline def couplesInsert = | |
quote((c: Couple) => query[Couple].insert(c)) | |
} | |
// Then this stuff was used in PeoplePostgresAsyncSpec | |
class PeoplePostgresAsyncSpec extends PeopleSpec { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.getquill.context.jasync | |
import com.github.jasync.sql.db.pool.ConnectionPool | |
import com.github.jasync.sql.db.{ ConcreteConnection, Connection, QueryResult, RowData } | |
import io.getquill.context.sql.SqlContext | |
import io.getquill.context.sql.idiom.SqlIdiom | |
import io.getquill.context.{ Context, TranslateContext } | |
import io.getquill.monad.ScalaFutureIOMonad | |
import io.getquill.util.ContextLogger | |
import io.getquill.{ NamingStrategy, ReturnAction } |
NewerOlder