Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDBMS specific features #416

Open
eeverman opened this issue Mar 4, 2022 · 1 comment
Open

RDBMS specific features #416

eeverman opened this issue Mar 4, 2022 · 1 comment

Comments

@eeverman
Copy link

eeverman commented Mar 4, 2022

Hi - I'm looking at Celesta for a work project. We use PostGreSQL, but we use several features that it doesn't look like Celesta supports:

  • spatial columns
  • partitions
  • advanced indexing features

Is there any way to way to inject some vendor specific DDL into the Celesta SQL? Or are there other strategies for dealing with these types of features with Celesta?

@inponomarev
Copy link
Member

Hi @eeverman ! So sorry for overlooking your question!!

Celesta DDL has undocumented feature EXEC NATIVE, that can work like this:

exec native POSTGRESQL before --{{
   /* any vendor-specific DDL goes here. It will be executed before each update of the schema and it must be idempotent (note'if exists')! */
   drop view if exists products_shops;
--}};

exec native POSTGRESQL after --{{
 /* This will be executed after each update of the schema, and it must be idempotent (note 'create or replace')!*/
  create or replace view products_shops as select distinct shop_id from market.products;
--}};

(also note --{{ and --}} markers: they are chosen in such a way that your native code will be highlighted by any SQL syntax highlighter, while in Celesta they denote the beginning and the end of native SQL literal)

However, this feature is disabled for Celesta since I'm not sure about its safety: it's your responsibility to make this code idempotent. But I've been asked to enable it, so if you're willing, I can enable.

Another used approach is to utilize Flyway for schema migration and Celesta only for data access (by marking all the tables that are managed by Flyway with no autoupdate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants