Add multi-prefix comment support for SQL scripts
Update `ResourceDatabasePopulator` and `ScriptUtils` so that more than one comment prefix can be used when processing SQL scripts. This feature is particularly useful when dealing with scripts provided by Quartz since they often use a mix `--` and `#`. Closes gh-23289
This commit is contained in:
committed by
Sam Brannen
parent
1ff29b0f6b
commit
17914fc44b
@@ -0,0 +1,18 @@
|
||||
-- The next comment line has no text after the '--' prefix.
|
||||
--
|
||||
-- The next comment line starts with a space.
|
||||
-- x, y, z...
|
||||
|
||||
insert into customer (id, name)
|
||||
values (1, 'Rod; Johnson'), (2, 'Adrian Collier');
|
||||
-- This is also a comment.
|
||||
insert into orders(id, order_date, customer_id)
|
||||
values (1, '2008-01-02', 2);
|
||||
# A comment with a different prefix
|
||||
insert into orders(id, order_date, customer_id) values (1, '2008-01-02', 2);
|
||||
INSERT INTO persons( person_id--
|
||||
, name)
|
||||
^ A comment with yet another different prefix
|
||||
VALUES( 1 -- person_id
|
||||
, 'Name' --name
|
||||
);--
|
||||
Reference in New Issue
Block a user