Skip to content
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

sqlite: test formatFilepath handling of paths w/wo trailing slash #228

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

jchappelow
Copy link
Member

A bug was fixed in https://github.com/kwilteam/kwil-db/pull/220/files#diff-dbaecd2f2532274edc2a7f21fd7ea499242a7cd1867303952f13bb54e8bfa8a1R87 so that the path used in sqlite connection did not have to assume a trailing slash.

I was looking into this with @charithabandi and I added a testable helper function to ensure this path construction always remains robust.

@jchappelow jchappelow changed the title sqlite: fix formatFilepath to handle paths w/wo trailing slash sqlite: test formatFilepath handling of paths w/wo trailing slash Aug 28, 2023
Copy link
Contributor

@charithabandi charithabandi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

func (c *Connection) formatFilePath(fileName string) string {
return fmt.Sprintf("%s.sqlite", filepath.Join(c.path, fileName))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charithabandi yeah, you did have the fix, I must have seen a commit slightly earlier. I'm adding the tests in this PR that I was writing from earlier.

@jchappelow jchappelow merged commit 656fc41 into main Aug 28, 2023
2 checks passed
@jchappelow jchappelow deleted the fix/sqlite-formatFilePath branch August 28, 2023 16:49
@jchappelow jchappelow added this to the v0.6.0 milestone Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants