question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

disableConstraints=true for H2 executes non-H2 SQL Statement

See original GitHub issue

I am using h2 version 2.0.202 and DBRider 1.32.0.

When I use @DataSet(value = "datasets/mydataset.yml", disableConstraints = true), this line will run a SET foreign_key_checks=0 statement, which is not supported by H2.

Instead, the command should be SET REFERENTIAL_INTEGRITY FALSE per documentation: https://www.h2database.com/html/commands.html#set_referential_integrity

So currently, I cannot use DataSets which would violate foreign key constraints.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rmpestanocommented, Feb 4, 2022

It’s probably best if you create a new bug report for your issue since it doesn’t match my reported one.

Yea, can you create a new issue @Matrino? also, it would be nice if we could reproduce in one of the DBRider samples.

Thanks for the feedback!

1reaction
bergerstcommented, Feb 4, 2022

In my projects, we haven’t encountered any errors after upgrading.

@Matrino It’s probably not related to disableConstraints but another DBRider feature. Maybe it’s caused by your own project files? I can’t find anything with INDEX_COLUMNS in this project.

It’s probably best if you create a new bug report for your issue since it doesn’t match my reported one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

H2 Dababase not executing sql query - spring boot
I am executing the query INSERT INTO ROLE VALUES (1, "ADMIN"); and its giving me an error Column "ADMIN" not found; SQL statement:...
Read more >
Running H2 in SQL Server Mode With Custom Schema Name ...
I want to use in-memory database but at the same time I don't want my tests to fail as soon as I use...
Read more >
Advanced - H2 Database Engine
The transaction is marked 'prepared' by executing the SQL statement PREPARE COMMIT transactionName; The transaction can now be committed or rolled back; If...
Read more >
Statement.execute throws Syntax error (206/210)
to H2 Database. This was not the case in 200. Syntax error in SQL statement "create table persons (mstb_per_no int [*]identity not null,...
Read more >
SQL Server Utilities Statements - GO - Microsoft Learn
These commands can be used to facilitate the readability and execution of batches and scripts. GO signals the end of a batch of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found