-
Notifications
You must be signed in to change notification settings - Fork 12
Add a pager for windows #33
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
Conversation
db/pager_unix.go
Outdated
@@ -106,7 +108,7 @@ func (f *filePager) CheckReservedLock() (bool, error) { | |||
lock := &unix.Flock_t{ | |||
Type: unix.F_WRLCK, | |||
Whence: seek_set, | |||
Start: sqlite_shared_first, | |||
Start: sqlite_reserved_byte, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looked like an unintentional typo from my reading of sqlite3.c, I can remove the change if I misunderstood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, must have been a copy from another Flock. Nice find!
Thanks for the PR! It looks good on a quick read, I'll read it properly in a bit.
I'm not sure what you refer to, but if it's the |
constants are shared between os lock implementations, so move them out of os-specific files also camelcases them
Thanks @alicebob - I was able to simplify this a lot once I discovered
yep, that's all I meant! added that in an extra commit on top. |
aside: It looks to me like there is a race condition for |
// around problems caused by indexing and/or anti-virus software on | ||
// Windows systems. | ||
// If you are using this code as a model for alternative VFSes, do not | ||
// copy this retry logic. It is a hack intended for Windows only. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice comment.
Thanks for the PR! I just merged it and called it v1.4.0. If you have an idea how to solve the race, that would be great, otherwise I'll have a look later. If you run into more problems please don't hesitate to open an issue. |
Getting this up for a quick sanity check while I work to verify these changes.
Background:
I'm using sqlittle in another project that needs to run on mac/linux/windows, didn't realize there was an os restriction until I'd gotten pretty far.
From reading go/internal and sqlite3, this seems like this will probably work - but I hit a snag testing, because
wine
has not implemented filelocks, and I primarily use linux/mac.Also - I copied the naming conventions from
pager_unix.go
, any objections if I update to be more in line with typical golang style?