-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix codegen ordering. Fix duplicate enums. Add JSONB basic support
- Loading branch information
Showing
7 changed files
with
84 additions
and
74 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
|
||
|
||
jsonb | ||
|
||
- include/exclude tables | ||
- override types | ||
|
||
- paging | ||
|
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 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 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 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
13 changes: 13 additions & 0 deletions
13
squery/postgres-jawn/src/ba/sake/postgres/jawn/reads.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package ba.sake.squery.postgres.jawn | ||
|
||
import java.{sql => jsql} | ||
import org.typelevel.jawn.ast.* | ||
import ba.sake.squery.read.* | ||
|
||
given SqlRead[JValue] with { | ||
def readByName(jRes: jsql.ResultSet, colName: String): Option[JValue] = | ||
SqlRead[String].readByName(jRes, colName).map(JParser.parseUnsafe) | ||
|
||
def readByIdx(jRes: jsql.ResultSet, colIdx: Int): Option[JValue] = | ||
SqlRead[String].readByIdx(jRes, colIdx).map(JParser.parseUnsafe) | ||
} |
15 changes: 15 additions & 0 deletions
15
squery/postgres-jawn/src/ba/sake/postgres/jawn/writes.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package ba.sake.squery.postgres.jawn | ||
|
||
import java.{sql => jsql} | ||
import org.typelevel.jawn.ast.* | ||
import ba.sake.squery.write.* | ||
|
||
given SqlWrite[JValue] with { | ||
def write( | ||
ps: jsql.PreparedStatement, | ||
idx: Int, | ||
valueOpt: Option[JValue] | ||
): Unit = valueOpt match | ||
case Some(value) => ps.setObject(idx, FastRenderer.render(value), jsql.Types.OTHER) | ||
case None => ps.setNull(idx, jsql.Types.OTHER) | ||
} |