From 6be96aba2cedc191aa1cad7dafe9c092f937a7c3 Mon Sep 17 00:00:00 2001 From: jilen Date: Wed, 18 Dec 2024 19:28:43 +0800 Subject: [PATCH] save --- src/main/scala/minisql/ast/FromExprs.scala | 7 +++++++ src/main/scala/minisql/context/Context.scala | 4 ++++ src/main/scala/minisql/idiom/ReifyStatement.scala | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/scala/minisql/ast/FromExprs.scala b/src/main/scala/minisql/ast/FromExprs.scala index 3541a76..9f70b0d 100644 --- a/src/main/scala/minisql/ast/FromExprs.scala +++ b/src/main/scala/minisql/ast/FromExprs.scala @@ -123,6 +123,13 @@ private given FromExpr[Query] with { Some(FlatMap(b, id, body)) case '{ ConcatMap(${ Expr(b) }, ${ Expr(id) }, ${ Expr(body) }) } => Some(ConcatMap(b, id, body)) + case '{ + val x: Ast = ${ Expr(b) } + val y: Ident = ${ Expr(id) } + val z: Ast = ${ Expr(body) } + ConcatMap(x, y, z) + } => + Some(ConcatMap(b, id, body)) case '{ Drop(${ Expr(b) }, ${ Expr(n) }) } => Some(Drop(b, n)) case '{ Take(${ Expr(b) }, ${ Expr[Ast](n) }) } => diff --git a/src/main/scala/minisql/context/Context.scala b/src/main/scala/minisql/context/Context.scala index 47f5f2e..8b3b96f 100644 --- a/src/main/scala/minisql/context/Context.scala +++ b/src/main/scala/minisql/context/Context.scala @@ -56,6 +56,10 @@ trait Context[I <: Idiom, N <: NamingStrategy] { selft => extract: RowExtract[X] ) + extension (ast: Ast) { + extractParams + } + inline def io[E]( inline q: minisql.Query[E] )(using r: RowExtract[E]): DBIO[Seq[E]] = { diff --git a/src/main/scala/minisql/idiom/ReifyStatement.scala b/src/main/scala/minisql/idiom/ReifyStatement.scala index aea8322..7c5b9a8 100644 --- a/src/main/scala/minisql/idiom/ReifyStatement.scala +++ b/src/main/scala/minisql/idiom/ReifyStatement.scala @@ -62,7 +62,7 @@ object ReifyStatement { statement: Statement, emptySetContainsToken: Token => Token, liftMap: SMap[String, (Any, Any)] - ): (Token) = { + ): Token = { ??? } }