Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

implement support for JSON type in mysql-async #238

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [[![Build Status](https://travis-ci.org/mauricio/postgresql-async.png)](https://travis-ci.org/mauricio/postgresql-async) postgresql-async & mysql-async - async, Netty based, database drivers for MySQL and PostgreSQL written in Scala 2.10, 2.11 and 2.12](#!build-statushttpstravis-ciorgmauriciopostgresql-asyncpnghttpstravis-ciorgmauriciopostgresql-async-postgresql-async-&-mysql-async---async-netty-based-database-drivers-for-mysql-and-postgresql-written-in-scala-210-and-211)
- This project is not being maintained anymore, feel free to fork and work on it
- [Abstractions and integrations](#abstractions-and-integrations)
- [Include them as dependencies](#include-them-as-dependencies)
- [Database connections and encodings](#database-connections-and-encodings)
Expand All @@ -22,7 +22,7 @@

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# [![Build Status](https://travis-ci.org/mauricio/postgresql-async.png)](https://travis-ci.org/mauricio/postgresql-async) postgresql-async & mysql-async - async, Netty based, database drivers for MySQL and PostgreSQL written in Scala 2.10, 2.11 and 2.12
# [![Build Status](https://travis-ci.org/mauricio/postgresql-async.png)](https://travis-ci.org/mauricio/postgresql-async) This project is not being maintained anymore, feel free to fork and work on it

The main goal for this project is to implement simple, async, performant and reliable database drivers for
PostgreSQL and MySQL in Scala. This is not supposed to be a JDBC replacement, these drivers aim to cover the common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class DecoderRegistry(charset: Charset) {

(columnType: @switch) match {
case ColumnTypes.FIELD_TYPE_VARCHAR |
ColumnTypes.FIELD_TYPE_ENUM => this.stringDecoder
ColumnTypes.FIELD_TYPE_ENUM |
ColumnTypes.FIELD_TYPE_JSON => this.stringDecoder
case ColumnTypes.FIELD_TYPE_BLOB |
ColumnTypes.FIELD_TYPE_LONG_BLOB |
ColumnTypes.FIELD_TYPE_MEDIUM_BLOB |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ object ColumnTypes {

final val FIELD_TYPE_YEAR = 13

final val FIELD_TYPE_JSON = 245

final val Mapping = Map(
FIELD_TYPE_BIT -> "bit",
FIELD_TYPE_BLOB -> "blob",
Expand Down Expand Up @@ -102,7 +104,8 @@ object ColumnTypes {
FIELD_TYPE_TINY_BLOB -> "tiny_blob",
FIELD_TYPE_VAR_STRING -> "var_string",
FIELD_TYPE_VARCHAR -> "varchar",
FIELD_TYPE_YEAR -> "year"
FIELD_TYPE_YEAR -> "year",
FIELD_TYPE_JSON -> "json"
)

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ object PostgreSQLColumnEncoderRegistry {
class PostgreSQLColumnEncoderRegistry extends ColumnEncoderRegistry {

private val classesSequence_ : List[(Class[_], (ColumnEncoder, Int))] = List(
classOf[Int] -> (IntegerEncoderDecoder -> ColumnTypes.Numeric),
classOf[java.lang.Integer] -> (IntegerEncoderDecoder -> ColumnTypes.Numeric),
classOf[Int] -> (IntegerEncoderDecoder -> ColumnTypes.Integer),
classOf[java.lang.Integer] -> (IntegerEncoderDecoder -> ColumnTypes.Integer),

classOf[java.lang.Short] -> (ShortEncoderDecoder -> ColumnTypes.Numeric),
classOf[Short] -> (ShortEncoderDecoder -> ColumnTypes.Numeric),
classOf[java.lang.Short] -> (ShortEncoderDecoder -> ColumnTypes.Smallint),
classOf[Short] -> (ShortEncoderDecoder -> ColumnTypes.Smallint),

classOf[Long] -> (LongEncoderDecoder -> ColumnTypes.Numeric),
classOf[java.lang.Long] -> (LongEncoderDecoder -> ColumnTypes.Numeric),
classOf[Long] -> (LongEncoderDecoder -> ColumnTypes.Bigserial),
classOf[java.lang.Long] -> (LongEncoderDecoder -> ColumnTypes.Bigserial),

classOf[String] -> (StringEncoderDecoder -> ColumnTypes.Varchar),
classOf[java.lang.String] -> (StringEncoderDecoder -> ColumnTypes.Varchar),
Expand Down
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object ProjectBuild extends Build {

object Configuration {

val commonVersion = "0.2.22-SNAPSHOT"
val commonVersion = "0.3.0-rogach"
val projectScalaVersion = "2.12.1"
val specs2Version = "3.8.6"

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 0.13.13
sbt.version = 0.13.17