sudr / dbdeploy

Automatically exported from code.google.com/p/dbdeploy
0 stars 0 forks source link

control comments / modlines #59

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I would like to see something like Vims modlines.

A control statement in sql comment that would allow us to set
delimiter or delimitertype per file (or other parameters).

At this point I'm running trigger deltas manually - my delimiter
in all files is ";", so probably i can't change it to other
(but i never tested it :P).

For example this could be placed in the beginning of file, one property per 
line in a format (for mysql):

-- dbdeploy.delimiter: $$
-- dbdeploy.delimitertype: row

so if we create "create trigger" statement this way:

delimiter $$

CREATE TRIGGER `trigger_name`
AFTER UPDATE ON `table_name`
FOR EACH ROW
BEGIN
  statement1;
  statement2;
END
$$

delimiter ;

then this delta with control comment would allow us to use it in "output" mode 
and in "database changes" mode without any changes.

Original issue reported on code.google.com by TothA...@gmail.com on 9 May 2011 at 10:04