elixir-sqlite / exqlite

An SQLite3 driver for Elixir
https://hexdocs.pm/exqlite
MIT License
198 stars 46 forks source link

Pass binary filename to sqlite3_open #278

Open greg-rychlewski opened 4 months ago

greg-rychlewski commented 4 months ago

Closes https://github.com/elixir-sqlite/exqlite/issues/277

This looks like it's your issue since Elixir strings at UTF-8 encoded. But I have to admit I'm not sure why it was latin-1 before. So I might be stepping on a landmine without knowing it.

greg-rychlewski commented 4 months ago

Ok I learned very quickly why it was ERL_NIF_LATIN1 before. It's because ERL_NIF-UTF8 is new. So instead of passing it as a charlist I pass it as a binary and then convert it to a proper null terminated string inside the nif.

greg-rychlewski commented 4 months ago

i'm pretty sure the failures are race conditions because they were not touched in this pr

greg-rychlewski commented 4 months ago

I guess it's not a race condition =(

warmwaffles commented 4 months ago

I'll take a look at this later in the evening.

warmwaffles commented 4 months ago

This may be an issue with how the filesystem represents utf8 characters in windows. I'm not a windows dev, but I think we'll need to dig in to wchar stuff for the filesystem. I suspect it's utf16.

warmwaffles commented 3 months ago

@greg-rychlewski it's been a while, can you try re-running the CI. I can't see where to kick it off on my end.

greg-rychlewski commented 3 months ago

@warmwaffles done