fix(sqlite3): support relative path for dbname#1471
Closed
KeitaShimura wants to merge 1 commit into
Closed
Conversation
stephenafamo
requested changes
May 27, 2026
Collaborator
There was a problem hiding this comment.
I don't understand why the tests needed to be modified.
Contributor
Author
There was a problem hiding this comment.
@stephenafamo
I have no plans to make any further fixes. Given the time that has passed, please go ahead and close the PR if it’s no longer needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
./mydb.sqlite) fordbnameinsqlboiler.tomlAssemble, thedbnameis resolved to an absolute path viafilepath.Abs()before building the connection stringProblem
When a relative path was given as
dbname, SQLite resolved it against the working directory at the time of execution. Since the working directory when running sqlboiler differs from the one used when running generated tests, the same relative path pointed to different locations, causingno such tableerrors.Changes
drivers/sqlboiler-sqlite3/driver/sqlite3.godbnameto an absolute path withfilepath.Abs()if it is not already absolutedrivers/sqlboiler-sqlite3/driver/sqlite3_test.gocreateSQLiteDBhelperfilepath.IsAbs()filepath.Abs()absolute_path/var/folders/.../mydb.sqltrue(no-op)relative_path../../../var/folders/.../mydb.sqlfalserelative_path_dot_slash././mydb.sqlfalseRelated issue
Related to #1409