Re: [sqlite] MS open source Portable Class Library for SQLite

2014-08-14 Thread Eric Sink
I would describe the msopentech PCL wrapper as slightly thick (because
it's trying to be higher level than the sqlite3 API itself), and quite
narrow (because it covers only a small part of the underlying sqlite3 API).

Related and possibly of interest:  My own C# wrapper is a fork of the one
from msopentech.  It's called SQLitePCL.raw.

The README on the github page contains a bunch of info about my wrapper and
its differences:

https://github.com/ericsink/SQLitePCL.raw

There are some NuGet packages:

https://www.nuget.org/packages/SQLitePCL.raw_basic/

https://www.nuget.org/packages/SQLitePCL.raw_needy/

SQLitePCL.raw is currently being used by:

The PCL version of the SQLite-net (a lightweight ORM by Frank Krueger)
NuGet package:

https://www.nuget.org/packages/sqlite-net-pcl/1.0.9-alpha

And Akavache:

https://github.com/akavache/Akavache

And I've been trying to clear the obstacles so that SQLitePCL.raw could
maybe be used by Entity Framework 7:

https://github.com/aspnet/DataCommon.SQLite/issues/21

--
E



On Thu, Aug 14, 2014 at 3:41 PM, Simon Slavin slav...@bigfraud.org wrote:


 On 14 Aug 2014, at 9:14pm, a...@zator.com wrote:

  May be that some know it already, but digging the Web to know about the
 client-side storage Web SQL Database, I've found this post of MS Open
 Technologies, that may be of interest to many of you who often ask about
 SQLite in Window Phone.
 
 
 http://msopentech.com/blog/2014/02/03/new-open-source-portable-class-library-sqlite/

 Thanks for the news, Adolfo.

 Would someone familiar with programming for this platform tell use how
 thick or thin this wrapper is ?

 Simon.

 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Cross-Platform ADO wrapper for iOS, Android and Win 8.1 WP 8.1?

2014-08-12 Thread Eric Sink
Short answer: no.

Longer answer:

Microsoft does not (yet?) support ADO on WinRT or WP8, much less on Xamarin
platforms.

But it looks like the future holds a glimmer of hope.  Their vNext project
seems to be heading toward portable ADO, and also includes SQLite support:

https://github.com/aspnet/DataCommon.SQLite

--
E


On Monday, August 11, 2014, Ken Wenyon weny...@msn.com wrote:

 Is there ADO Support for SQLite using Windows 8.1 and Windows Phone 8.1?
  I am looking for a Cross-Platform ADO wrapper for iOS, Android and Win 8.1
 WP 8.1?


 Ken Wenyon
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.8.6 coming soon

2014-08-07 Thread Eric Sink
FWIW, the Zumero test suite is fairly abusive and it passes all test cases
with 3.8.6 beta.

--
E



On Thu, Aug 7, 2014 at 11:59 AM, Richard Hipp d...@sqlite.org wrote:

 On Thu, Aug 7, 2014 at 10:01 AM, E.Pasma pasm...@concepts.nl wrote:

  I have a case where a primary key index is no longer used where it was
  used before.
 

 Thank you for the test case!

 This problem should now be addressed on trunk and in the pre-release
 snapshots.  Please retry using the latest and let me know if you continue
 to see problems or if you see anything new.  Thanks.

 --
 D. Richard Hipp
 d...@sqlite.org
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite3_create_collation

2014-04-02 Thread Eric Sink
Does this mean all your interaction with SQLite is happening through Core
Data?

E
 On Apr 2, 2014 1:05 PM, Donald Steele xln...@sbcglobal.net wrote:

 I am working in iOS (aka ObjC) so I am using it's built in framework for
 all my SQLite calls.


 On Apr 2, 2014, at 10:58 AM, Simon Slavin slav...@bigfraud.org wrote:

 
  On 2 Apr 2014, at 6:56pm, Donald Steele xln...@sbcglobal.net wrote:
 
  Registering of the custom collation is far from intuitive (for me) and
 thus the reason for my question.
 
  What programming language is your collation function written in ?
 
  How are you calling your SQLite functions ?  Are you doing C calls to
 the C API, or are you calling a SQLite library or framework from another
 language ?
 
  Simon.
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Should System.Data.SQLite.EF6.SQLiteProviderServices be public?

2014-02-22 Thread Eric Sink

After reading this:

http://msdn.microsoft.com/en-us/data/jj680699.aspx

about Code-based Configuration in EF6, I wonder if

System.Data.SQLite.EF6.SQLiteProviderServices

needs to be public (instead of internal), so that people could do something 
like this:

public class MyConfiguration : DbConfiguration
{
public MyConfiguration()
{
this.SetProviderServices(System.Data.SQLite, 
System.Data.SQLite.EF6.SQLiteProviderServices.Instance);
}
}

--
E

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] to encrypt sqlite db

2013-08-31 Thread Eric Sink

SQLCipher is free.

But it's not compatible with WinRT.

I'm pretty sure that right now there is nothing that meets both of your 
requirements.

--
E


On Aug 31, 2013, at 8:52 AM, dd durga.d...@gmail.com wrote:

 Thank you for your quick response.
 
 I am looking for freeware. If freeware not available, I have to implement
 encryption support for sqlite on winrt.
 
 What is the procedure to implement encryption support on winrt?
 
 Thanks,
 dd
 
 
 On Sat, Aug 31, 2013 at 6:34 PM, Stephan Beal sgb...@googlemail.com wrote:
 
 On Sat, Aug 31, 2013 at 2:59 PM, Mohit Sindhwani m...@onghu.com wrote:
 
 Adding on to Paolo's answer, see this: http://www.hwaci.com/sw/**
 sqlite/prosupport.html http://www.hwaci.com/sw/sqlite/prosupport.html
 See SEE and CEROD on that page.
 
 @devs: minor typo on that page:
 
 The SQLite software free and it works great.
 
 missing is
 
 --
 - stephan beal
 http://wanderinghorse.net/home/stephan/
 http://gplus.to/sgbeal
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite patch contribution

2013-07-22 Thread Eric Sink

You could include us as another group who would like to see this functionality 
added to virtual tables.

--
E


On Jul 22, 2013, at 8:46 AM, Richard Hipp d...@sqlite.org wrote:

 On Mon, Jul 22, 2013 at 10:27 AM, Dušan Paulovič paulo...@gisoft.cz wrote:
 
 So, in other words, there is no way for programmers from EU to contribute
 on SQLite?
 Is there any other option?
 Is there a plan to solve xBestIndex collation issue?
 
 Actually implementing such a patch is trivial.  We'll do that for you.  Not
 a problem.
 
 The real work comes in (1) testing the new features (2) documenting the new
 feature, and especially (3) supporting the new feature moving forward.
 These three items, and especially the third item, involve orders of
 magnitude more time and effort than actually implementing the patch.
 
 So if having the ability to use collating sequences in virtual tables is
 something that is important to you, then you have to sell the idea.  You
 have to convince the core team that your new feature is important and
 useful and ought to be supported.
 
 Submitting a proof of concept patch might be part of your sales pitch, as
 a way of showing that the feature is feasible and does not impact
 performance and will be easy to support.  But the patch is only a small
 part of your sales pitch.  You still need to convince the core team that
 what you are trying to do is necessary and important and will be of benefit
 to a large number of users.
 
 
 -- 
 D. Richard Hipp
 d...@sqlite.org
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite database on Dropbox, Google Drive, MS SkyDrive, Ubuntu One or SAMBA share

2013-07-03 Thread Eric Sink

FYI:  For a different approach, check out Zumero (http://zumero.com) which 
synchronizes SQLite changes within the db rather than the whole db as a file.

Disclosure:  I am a co-founder of Zumero, which is commercial, proprietary, 
non-open-source, etc.  I mention this only because we often describe Zumero as 
like Dropbox, except for data instead of files, so it might be relevant for 
the participants of this thread.  Apologies if this note is out of line.  Feel 
free to ignore me.  If your initials are DRH, feel free to scold me.

--
E


On Jul 3, 2013, at 9:27 AM, Gerry Snyder mesmerizer...@gmail.com wrote:

 On 6/27/2013 12:38 PM, joe.fis...@tanguaylab.com wrote:
 Anyone,
 
 Does anyone have good or bad experiences using a SQLite database in a shared 
 folder?
 The 'Dropbox / Drive / SkyDrive / One' 
 
 I use Dropbox for SQLite files a lot. If I am not careful to be making 
 changes to a file on only one PC at a time, I can get a Conflicted copy on 
 one of the machines, but by and large it has worked very well.
 
 I can not think of any way Dropbox could be handling things better.
 
 
 Gerry
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] BEGIN IMMEDIATE and the busy handler

2013-06-25 Thread Eric Sink


From reading sqlite3.c and the comments therein, it would appear that 
BEGIN IMMEDIATE TRANSACTION never invokes the busy handler.


Is that correct?

--
E

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] System.Data.SQLite and sqlite3_prepare()

2013-03-20 Thread Eric Sink


It looks like System.Data.SQLite uses sqlite3_prepare() instead of 
sqlite3_prepare_v2().


Is there a technical reason for this?

Just curious.

--
E

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Announcing Zumero (commercial venture, built on SQLite)

2013-03-14 Thread Eric Sink


I'll keep this short and low-key:

Zumero is a sync solution for SQLite, designed for mobile devices.

http://zumero.com/

Here's my blog post on it:

http://ericsink.com/entries/announcing_zumero.html

--
E


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite 3.7.16 beta

2013-03-02 Thread Eric Sink


FWIW:  I am working on a project which uses SQLite extensively.  We 
generally use 3.7.11 on our client side and 3.7.15.2 on our server. I 
just switched both to this 3.7.16 beta, and all our automated tests 
still pass.


--
E


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Maybe bug with vtab xDestroy

2013-02-28 Thread Eric Sink


In xRename, if I set zErrMsg and return SQLITE_ERROR, the error message 
gets through.


In xDestroy, using the same code, the error message seems to get eaten.

Bug?

My code:

static int my_Destroy(sqlite3_vtab *tab)
{
struct my_vtab* pvtab = (struct my_vtab*) tab;
if (pvtab-zErrMsg) sqlite3_free(pvtab-zErrMsg);
pvtab-zErrMsg = sqlite3_mprintf(whatever);
return SQLITE_ERROR;
}

This is with 3.7.15.2

--
E


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Return Value from sqlite3_exec()

2013-02-22 Thread Eric Sink


In your example, the only way SQLite can do what you expect is to notice 
that your UPDATE didn't modify any rows.


But you don't want an UPDATE statement throwing errors simply because it 
didn't modify any rows.  There are many situations where that happens 
and is considered normal behavior.


UPDATE table1 SET site='Site1' WHERE site='garbage';

In your example, you know what garbage looks like.  SQLite does not.  
Mere absence of that value from the column does not qualify it as garbage.


OTOH, I do sometimes like to put this line (or something like it):

assert(1 == sqlite3_changes(db));

after an UPDATE when I know that it should have changed exactly one row.

--
E


On 2/22/13 3:15 PM, Frederick Wasti wrote:

[A newbie to SQLite here...]

From the documentation on sqlite3_exec(), it seems as if it should return
SQLITE_OK (=0) upon processing a successful SQL query. However, I was a
bit surprised to see that an SQL statement such as UPDATE table1 SET
site='Site1' WHERE site='garbage' (where garbage really is garbage, as in
not being present in the database) results in an SQLITE_OK return.

I guess there are two ways of looking at this: On the one hand, the SQL
statement cannot succeed, so the return should not be SQLITE_OK. On the
other hand, an SQL statement which would be impossible to process, but
which would nonetheless be handled with aplomb by sqlite3_exec(), should
return SQLITE_OK after all (in the sense that sqlite3_exec() did do its job
OK). (???)

So, my question is: Is it correct for sqlite3_exec() to return SQLITE_OK if
the SQL query is doomed to failure (but is otherwise properly formed)?

Thanks.

Fred

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] From SQLITE_CONSTRAINT to something more specific

2013-02-09 Thread Eric Sink


I'm trying to use information from sqlite3_errmsg() to figure out what 
*kind* of SQLITE_CONSTRAINT happened.


Cruising the archives of this mailing list, I see past discussions about 
the desire for really complete error information, including the name of 
the specific constraint that failed (and ideally in a format which does 
not need to be parsed or is designed to be parsed).  I add my vote for 
how cool that functionality would be. For now, I'm just looking for a 
way to distinguish between the major types of constraint violations, 
(unique, check, foreign key, etc).


I would welcome remarks from the SQLite developers on the code snippet 
below.


Specific questions:

(1)  What is the likelihood of future changes to the phrasing of 
sqlite3_errmsg() strings?


(2)  Is there any situation where (0 == strcmp(sqlite3_errmsg(db), 
constraint failed)) and the violation was NOT a CHECK constraint?


(3)  Dare I hold out hope for extended error codes like the following?

#define SQLITE_CONSTRAINT_UNIQUE  (SQLITE_CONSTRAINT | (18) )
#define SQLITE_CONSTRAINT_FOREIGN_KEY (SQLITE_CONSTRAINT | (28) )
#define SQLITE_CONSTRAINT_CHECK   (SQLITE_CONSTRAINT | (38) )
#define SQLITE_CONSTRAINT_NOT_NULL(SQLITE_CONSTRAINT | (48) )

My code snippet:


if (SQLITE_CONSTRAINT == rc)
{
const char* psz_errmsg = sqlite3_errmsg(psql);

// We're on thin ice here.  sqlite doesn't make any promises about
// what the errmsg string will contain for various constraint 
violations.
// Nonetheless, this works.  If sqlite changes the errmsgs in the 
future,

// this will break.  We've got test cases to detect this.

if (strstr(psz_errmsg, not unique))
{
// TODO should occur at the end of the string
...
}
else if (strstr(psz_errmsg, foreign key))
{
// TODO could check for exact strcmp match to foreign key 
constraint failed


...
}
else if (strstr(psz_errmsg, constraint failed))
{
// TODO could check for exact strcmp match to constraint failed
// TODO riskiest one, since sqlite doesn't say it was a check 
constraint
// TODO but it seems to use a more specific phrase in all other 
cases except check constraints


...
}
}


Thanks!

--
E

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3_initialize() before sqlite3_randomness()

2013-01-15 Thread Eric Sink


So it appears that if the very first SQLite function you call is 
sqlite3_randomness(), it crashes.


And if you call sqlite3_initialize() first, it does not crash.

Just thought I should let somebody know...

--
E

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_initialize() before sqlite3_randomness()

2013-01-15 Thread Eric Sink


Yeah, I did read that page, but not well enough.

I saw this:

Workstation applications using SQLite normally do not need to invoke 
either of these routines.


And this (all-caps emphasis mine):

The sqlite3_initialize() routine is called internally by MANY other 
SQLite interfaces so that an application usually does not need to invoke 
sqlite3_initialize() directly.


But I missed this:

it is recommended that applications always invoke sqlite3_initialize() 
directly prior to using any other SQLite interface


So I ended up thinking maybe the current behavior was unknown or unintended.

Anyway.  Nothing to see here...

--
E




___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Two-line patch to fix memory leak

2012-05-11 Thread Eric Sink


In sqlite3Fts3Matchinfo():

Near the end of the function, I added two lines:

  if( rc!=SQLITE_OK ){
sqlite3_result_error_code(pContext, rc);
  }else{
int n = pCsr-nMatchinfo * sizeof(u32);
sqlite3_result_blob(pContext, pCsr-aMatchinfo, n, SQLITE_TRANSIENT);
ADDED:sqlite3_free(pCsr-aMatchinfo);
ADDED:   pCsr-aMatchinfo = 0;
  }

Notes:

1.  I added these two lines while obtaining zero actual understanding of 
the internals of sqlite.  Like a monkey typing random characters, I 
opened vi and hit keys until the leak went away.  I have no reason to 
believe these lines are correct.  All I know is that our test suite 
shows some memory leaks unless these two lines are present.


2.  I first did this fix back when 3.7.5 was released.  And then I 
procrastinated about submitting the patch to the mailing list, because I 
wanted to wait until I could say something insightful about sqlite 
internals, to make me look smarter than the aforementioned monkey.  
Anyway, we've got over a year of experience running with sqlite 3.7.5 
plus this patch, and no problems.


3.  This week we upgraded to 3.7.11 and the leaks showed up again.  So I 
reapplied this little patch, and the leaks went away again.  And this 
time, I have decided not to let my cluelessness prevent me from letting 
you folks know about it.


So, FWIW, there it is.  :-)

--
E

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Two-line patch to fix memory leak

2012-05-11 Thread Eric Sink

Oh darn.

If the leak is not obvious to you, and if my patch would cause an undesirable 
side effect, then the leak may somehow be the fault of our code.

I'll have to dig into this a bit further.  Sending you our whole tree would be 
somewhat less than constructive.  Maybe I can narrow down to a small test case.

For now, I can confirm that we have made no other changes to our copy of 3.7.11.

Thanks,

--
E


On May 11, 2012, at 12:50 PM, Dan Kennedy danielk1...@gmail.com wrote:

 On 05/11/2012 11:28 PM, Eric Sink wrote:
 
 In sqlite3Fts3Matchinfo():
 
 Near the end of the function, I added two lines:
 
 if( rc!=SQLITE_OK ){
 sqlite3_result_error_code(pContext, rc);
 }else{
 int n = pCsr-nMatchinfo * sizeof(u32);
 sqlite3_result_blob(pContext, pCsr-aMatchinfo, n, SQLITE_TRANSIENT);
 ADDED: sqlite3_free(pCsr-aMatchinfo);
 ADDED: pCsr-aMatchinfo = 0;
 }
 
 Thanks for posting this.
 
 Looking at the code, I can't see how the memory leak occurs. Do
 you have any idea how to trigger it? Other than this patch, are
 you using unmodified 3.7.11 FTS code?
 
 We can't apply the patch as is, even though it is safe (does not
 introduce any bugs), because it makes queries that use the 'x'
 format specifier with matchinfo() much less efficient.
 
 Dan.
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Details on New Features

2012-05-04 Thread Eric Sink

Is this new syntax likely to perform any better than the traditional way of 
writing the query?

--
E


On May 4, 2012, at 11:42 AM, Nico Williams n...@cryptonector.com wrote:

 On Fri, May 4, 2012 at 9:20 AM, Richard Hipp d...@sqlite.org wrote:
 Queries of the form: SELECT max(x), y FROM table returns the
 value of y on the same row that contains the maximum x value.
 
 Is that standard SQL behavior?  I'd have expected that to return one row
 for every row in the table.  To get the behavior described above, I'd use
 SELECT x, y FROM table WHERE x = (SELECT max(x) FROM table).
 
 It is definitely NOT standard behavior.  The standard behavior is
 undefined.  Or (with many SQL engines) it will throw an error if you have a
 term in the result set that is not part of an aggregate function or an
 element of the GROUP BY clause.  But lots of newbies expect SQL to work as
 described in the 3.7.11 release comments, and we used to get support
 questions because it did not.  And so rather than continue to answer the
 questions over and over, I figured it would be easier to tweak SQLite to
 reliably do what newbies expect.  I never anticipated that this change
 would be so controversial or confusing.
 
 This is very clever.  I'm not sure that an informative error message
 wouldn't have been better, but I think you made the right choice given
 SQLite3's previous behavior.  A pragma by which to cause SQLite3 to
 return an error instead might be useful, but then, it's SQL_Lite_.
 
 Is there any way to define aggregate functions that pick a row for
 providing column values in non-aggregate expressions?  E.g., you could
 have a median() or mode(), no?  I don't think this is important, am
 just curious.
 
 Nico
 --
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users