-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Document supported SQL comment prefixes #38385
Conversation
Refine the note about SQL comments in the documentation for initializing a database using basic SQL scripts in Spring Boot. The revised statement provides clearer guidance on using `--` for single-line comments and `/*` and `*/` for block comments, with a caution about potential issues with other comment formats.
Hello! Which SQL dialect are you using that |
mysql and mariadb support # comments. |
I wonder if we should make the comment settings configurable so that you can continue to use |
Ah, never mind, i found an old discussion about that: #16820 |
Thank you very much and congratulations on your first contribution 🎉! |
Situation
I am attempting to initialize a database following the instructions in the Spring Boot documentation under the "Initialize a Database Using Basic SQL Scripts" section.
When initializing the database with SQL files using
sql.init.mode=always
, you can specify the SQL file for initialization in the/resources
directory (e.g.,/resources/schema.sql
).Below is the content of the
/resources/schema.sql
file for initializing the schema:In
schema.sql
, '#' is used for inline comments. However, since theDEFAULT_COMMENT_PREFIX
is '--', some SQL statements were not parsed correctly, leading to issues as shown in the following image:As a result, the table creation for
firstTable
, as specified inschema.sql
, was ignored:To avoid any potential misunderstanding, I suggest adding a mention of this issue in the documentation.
Changes
Added the following statement to [[howto.data-initialization.using-basic-sql-scripts]]