From 78932b476b44732a30248c8778f35f0a98f6ef6a Mon Sep 17 00:00:00 2001 From: Rogach Date: Sun, 26 Nov 2017 12:34:21 +0300 Subject: [PATCH 1/4] implement support for JSON type in mysql-async --- .../mauricio/async/db/mysql/codec/DecoderRegistry.scala | 3 ++- .../github/mauricio/async/db/mysql/column/ColumnTypes.scala | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/codec/DecoderRegistry.scala b/mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/codec/DecoderRegistry.scala index 798f9231..ad79fed4 100644 --- a/mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/codec/DecoderRegistry.scala +++ b/mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/codec/DecoderRegistry.scala @@ -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 | diff --git a/mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/column/ColumnTypes.scala b/mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/column/ColumnTypes.scala index b8bc89f7..81abb196 100644 --- a/mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/column/ColumnTypes.scala +++ b/mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/column/ColumnTypes.scala @@ -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", @@ -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" ) } From 5716ac43818b6be0dc4fcc2b2655dde3411cdbe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Linhares?= Date: Tue, 21 Aug 2018 13:52:25 -0400 Subject: [PATCH 2/4] Adding message with project not being maintained anymore --- README.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index b15d4885..79f4b057 100644 --- a/README.markdown +++ b/README.markdown @@ -1,7 +1,7 @@ -- [[![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) @@ -22,7 +22,7 @@ -# [![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 From eabfd7c7417790ed1429131ed1396484ac8595a0 Mon Sep 17 00:00:00 2001 From: Rogach Date: Thu, 27 Dec 2018 21:06:52 +0300 Subject: [PATCH 3/4] use proper column types in postgresql column encoder registry, do not send all integer types as numeric --- .../column/PostgreSQLColumnEncoderRegistry.scala | 12 ++++++------ project/Build.scala | 2 +- project/build.properties | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/PostgreSQLColumnEncoderRegistry.scala b/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/PostgreSQLColumnEncoderRegistry.scala index c9f95f43..144b9531 100644 --- a/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/PostgreSQLColumnEncoderRegistry.scala +++ b/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/PostgreSQLColumnEncoderRegistry.scala @@ -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), diff --git a/project/Build.scala b/project/Build.scala index b543b050..36619995 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -49,7 +49,7 @@ object ProjectBuild extends Build { object Configuration { - val commonVersion = "0.2.22-SNAPSHOT" + val commonVersion = "0.3.0" val projectScalaVersion = "2.12.1" val specs2Version = "3.8.6" diff --git a/project/build.properties b/project/build.properties index e0cbc71d..cd7364c1 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 0.13.13 \ No newline at end of file +sbt.version = 0.13.17 \ No newline at end of file From 60d742210be66df3304271f7d810374580d1ec25 Mon Sep 17 00:00:00 2001 From: Rogach Date: Sun, 27 Jan 2019 00:37:52 +0300 Subject: [PATCH 4/4] tweak the version to avoid possible unexpected shadowing --- project/Build.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Build.scala b/project/Build.scala index 36619995..76598262 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -49,7 +49,7 @@ object ProjectBuild extends Build { object Configuration { - val commonVersion = "0.3.0" + val commonVersion = "0.3.0-rogach" val projectScalaVersion = "2.12.1" val specs2Version = "3.8.6"