From 7aab78b6ed3f1d43a27be372713ec1a68cf2281f Mon Sep 17 00:00:00 2001 From: Aleksandr Shabalin Date: Fri, 20 Sep 2024 14:30:23 +0300 Subject: [PATCH] Added doc for Const type for cqlt interpolator --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7485f81..4509504 100644 --- a/README.md +++ b/README.md @@ -100,9 +100,10 @@ trait Dao[F[_]] { object Dao { - private val insertQuery = cqlt"insert into table (id, data) values (${Put[Int]}, ${Put[String]})" + private val tableName = "table" + private val insertQuery = cqlt"insert into ${Const(tableName)} (id, data) values (${Put[Int]}, ${Put[String]})" .config(_.setTimeout(1.second.toJava)) - private val selectQuery = cqlt"select id, data from table where id = ${Put[Int]}".as[Model] + private val selectQuery = cqlt"select id, data from ${Const(tableName)} where id = ${Put[Int]}".as[Model] def apply[F[_]: Async](session: CassandraSession[F]) = for { insert <- insertQuery.prepare(session)