ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Paschenko <alexander.a.pasche...@gmail.com>
Subject Re: DDL implementation details
Date Mon, 16 Jan 2017 11:23:19 GMT
Sergi,

Regarding CREATE SCHEMA/TABLE parsing:

2017-01-12 18:51 GMT+03:00 Sergi Vladykin <sergi.vladykin@gmail.com>:
> Hi,
>
> 1. For now I'm against inventing any custom SQL syntax and implementing
> parsing.
> Currently H2 supports the following syntax:
>
> CREATE TABLE test(...) WITH "myCustomParamString"
>
> This is enough for us to pass the needed parameters.

H2's grammar requires to supply table engine class name as well, you
can't just go with WITH:

http://www.h2database.com/html/grammar.html#create_table

And code of H2's org.h2.command.Parser works exactly like this - you
can't just set default engine in connection string, in order to use
WITH, you have to specify both engine and WITH.

So we have either to force users to specify engine in their queries
(ugly and hardly acceptable), or have to somehow analyze CREATE TABLE
and sneak ENGINE param into the query ourselves.

But this again smells custom parsing, if you ask me.

>
> 2. Agree with AG, we have to separate cache creation from table creation.
> Cache == SQL schema for us. We just have to add the same WITH syntax in H2
> for schema creation like this:
>
> CREATE SCHEMA "MyCacheName" WITH "cacheConfig=myCache.xml"
>

Currently H2 does not allow using WITH with CREATE SCHEMA, proof:
http://www.h2database.com/html/grammar.html#create_schema

Do you suggest that we should somehow introduce this syntax to H2 engine first?

In the light of this, CREATE CACHE might seem legit. Thus, if we
depart from CREATE SCHEMA == create cache and introduce custom syntax
for CREATE CACHE, then we'll end up closer to what Vlad suggest –
schema is a logical object, caches exist on their own right.

Also, to add to Vlad's thoughts on Ignite becoming a database, I would
like to point out that for now we have talked only about schemas,
tables, and caches, but there are also *databases* as organizational
entities. Shouldn't we start thinking about those as well?

- Alex

Mime
View raw message