On Wed, May 31, 2017 at 12:09 AM, Alexander Zaytsev <
haz...@gmail.com> wrote:
> Hi,
>
> I want to start talking about the JSON support for NHibernate. It seems this
> is a long-awaited feature, which, if properly implemented can give us some
> advantages over the other "shall not be named here" ORM.
Well, the first question is, what is NHibernate accomplishing by this,
or the other "shall not be named here" ORM?
> I'll try to summarize the current state and what's needed to be done to
> implement this feature.
>
> Current support of RDBMs engines
>
> The current state of the RDBMS (not all of them, only the ones we care most
> about)
>
> Postgres 9.3+ - Supports json and jsonb column types.
> Microsoft SQL Server 2016 - Supports some JSON functions over an NVARCHAR
> columns
What kind of support do you expect for 2012? 2014?
> Oracle 12c - Supports some JSON functions over VARCHAR2, CLOB, and BLOB
> columns
> SQLite - Has a loadable JSON extension
> MySQL 5.7+ - Supports some JSON functions over JSON column type
Otherwise, any migration path at my disposal at the moment may lend
itself to MySQL paths.
> Firebird - no support.
>
>
> Persisting/Loading
>
> The challenge here is that different RDBMS use different approaches how they
> store the JSON data. Also, as Microsoft has decided to store JSON as a
> string it's most likely that there will be no DbType.Json added to the
>
ADO.NET.
>
> There are several sensible ways to represent json data on the client side:
>
> as a String
> as a POCO object
> as a JObject (
JSON.NET) or JsonObject (System.Json)
I'm not sure I would accept a tertiary dependency. But I'm also not
sure what a System.Json would incur.
A POCO object?
More likely, just support a String, and leave it to client side and/or
domain design time decisions, IMO.
> Querying RDBMS
>
> It seems that there are 2 main approaches how the RDBMS support querying the
> JSON data:
>
> Arrow (Postgres, MySQL) or dot notations (Oracle)
> A single function to extract part of the json data: json_extract (MySQL,
> SQLite) or json_extract_path (Postgres)
> Two functions to extract part of the json data: json_value (to return a
> scalar value) and json_query (to return object or array). This is supported
> by SQL Server & Oracle
> SQL Server will return NULL or throw an error (depending on a server
> configuration) if the incorrect function is used.
Which begins to explain what sort of dependency are we talking about
here. I wouldn't expect that JSON support would be native, which gets
challenging no matter how you slice it.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nhibernate-development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
nhibernate-develo...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.