<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 9, 2014 at 8:59 AM, Jeff Hardy <span dir="ltr"><<a href="mailto:jdhardy@gmail.com" target="_blank">jdhardy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Fri, May 9, 2014 at 12:01 PM, Doug Blank <<a href="mailto:doug.blank@gmail.com">doug.blank@gmail.com</a>> wrote:<br>

> On Fri, May 9, 2014 at 4:42 AM, Jeff Hardy <<a href="mailto:jdhardy@gmail.com">jdhardy@gmail.com</a>> wrote:<br>
>><br>
>> On Thu, May 8, 2014 at 5:32 PM, Doug Blank <<a href="mailto:doug.blank@gmail.com">doug.blank@gmail.com</a>> wrote:<br>
>> > Just getting back to attempting to use sqlite3 on computers other than<br>
>> > Windows, and it looks like this C# library has other problems on other<br>
>> > OSes.<br>
>> ><br>
>> > The first issue is that it appears that all activity must happen in the<br>
>> > same<br>
>> > thread (connection, cursor, execution). That can mitigated against if<br>
>> > that<br>
>> > is the way that it has to be. (A wrapper could be supplied to run<br>
>> > everything<br>
>> > in a specific thread).<br>
>> ><br>
>> > The next problem is a show stopper:<br>
>> ><br>
>> > import sqlite3<br>
>> > conn = sqlite3.connect("test.db")<br>
>> > cur = conn.cursor()<br>
>> > cur.execute("select * from tables;")<br>
>> ><br>
>> > This works on Windows, but gives a SystemError: LockFileEx on Linux. I<br>
>> > suspect that the information that Ivan pointed to (below) indicates that<br>
>> > these patches screwed up sqlite port so that it no longer will work on<br>
>> > Linux<br>
>> > and Mac.<br>
>> ><br>
>> > Anyone have ideas, on either a fix, or using a different library,<br>
>> > different<br>
>> > version?<br>
>><br>
>> Right now, I don't know if there's much that can be done. The C#<br>
>> SQLite port it uses is pretty Windows-specific, and I doubt it's worth<br>
>> the effort to fix it since it's no longer maintained anyway. I've been<br>
>> pondering replacing the guts of the SQLite module with<br>
>> <a href="https://github.com/ericsink/SQLitePCL.raw" target="_blank">https://github.com/ericsink/SQLitePCL.raw</a>, which wraps the *actual*<br>
>> SQLite library instead of the C# port.<br>
>><br>
>> The module implementation shouldn't have to change that much, since<br>
>> most of the function names should be the same. I don't yet know if<br>
>> SQLitePCL works on Unix/Mac but it does support Android and iOS so<br>
>> it's probably going to be a lot easier to fix it than it would be for<br>
>> C#-SQLite.<br>
>><br>
>> I hadn't planned on this until IronPython 3, but I'd be very happy to<br>
>> include it in 2.7.5 (or a possible 2.7.6) if someone else does the<br>
>> work.<br>
><br>
><br>
> Thanks for the information!<br>
><br>
> As I am also interested in other .NET/Mono languages (and other DB<br>
> connections), I wonder if we are going to spend any time on this, if it<br>
> wouldn't be better to use (and perhaps refine, if needed) the <a href="http://ADO.NET" target="_blank">ADO.NET</a> Sqlite<br>
> interface:<br>
><br>
> <a href="http://www.mono-project.com/SQLite" target="_blank">http://www.mono-project.com/SQLite</a><br>
><br>
> Perhaps it is better to move away from the sqlite-specific API and towards a<br>
> standard that would allow people to move between db backends? I suspect Vern<br>
> may have some information on this point, considering his recent announcement<br>
> here on adodbapi version 2.6.<br>
<br>
</div></div>I actually tried to use that, originally, but Python's sqlite module<br>
exposes some low-level features of SQLite that can't be emulated with<br>
an ADO-type interface. The only way to implementing it faithfully is<br>
to have direct(ish) access to the SQLite library.<br>
<br>
Most real apps will use a higher-level wrapper, but IronPython still<br>
needs to provide the sqlite module, since most of the high-level<br>
wrappers will expect it to be there.<br></blockquote><div><br></div><div>Agreed. But maybe there is a way to still use the Mono.Data.Sqlite code base? Perhaps add in more functionality (wouldn't be exposed by ADO), accessible via a intermediate API. It seems a waste to have two low-level interfaces to sqlite3...</div>
<div><br></div><div>-Doug</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
- Jeff<br>
</font></span></blockquote></div><br></div></div>