Re: [sqlite] Programming API vs console

2013-04-27 Thread Brad Hards

On 27/04/13 18:07, Igor Korot wrote:

CREATE TABLE playersdrafted(playerid integer, id ineteger,

Don't think ineteger is what you really mean.:)
Seen it twice now so guessing it's actually in the code



Why you say so?
It is a foreign key representation, so integer is perfectly normal column
type.
I think the point is that "integer" might be, but the pasted code shows 
"ineteger", which isn't the same thing.


Does the real code have "ineteger" or "integer"?

Brad

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


Re: [sqlite] To import csv file in C#

2013-02-10 Thread Brad Hards

On 09/02/13 13:49, mukesh kumar mehta wrote:

Is there any option to import csv file into sqlite database with the
help of System.Data.Sqlite.dll. As like shell command ".import
file_name table_name".

SpatiaLite can do this (either as a virtual table, or an import). There
are probably other extensions that can do this too.


As like "bulk insert" which uses in sqlserver. As like "Load Data"
which uses in mysql.

This doesn't make as much sense in SQLite, because you'd be better off
just creating a new SQLite database and moving that around rather than
some dump format.

Brad

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


Re: [sqlite] Trigger blocks a single transaction?

2012-12-23 Thread Brad Hards
On Monday 24 December 2012 11:04:29 Alem Biscan wrote:
> Hi,
> 
> No, i do not execute begin/commit. It is VIEW'S INSTEAD OF UPDATE TRIGGER.
> I am doing a regular update to the view from C#. Another thing is that view
> doesn't return any row affected value. Well it makes sense somehow.. It
> cannot know how many view's visible rows were affected. It lowers the
> coolnes of views and instead of trigs.
You cannot DELETE, INSERT, or UPDATE a view. Views are read-only in SQLite. 
However, in many cases you can use an INSTEAD OF trigger on the view to 
accomplish the same thing. Views are removed with the DROP VIEW command.
[http://www.sqlite.org/lang_createview.html]

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


Re: [sqlite] Database sharing across processes

2012-07-07 Thread Brad Hards
On Saturday 07 July 2012 01:00:01 Jonathan Haws wrote:
> For example, let's say I have two processes that connect to the same
> database file.  One process wants to read from the database, but the other
> process is in the middle of a write.  Does the first process pend on the
> read or not?  If it does not, what does it return?  Is it a successful
> read?  What about the reverse case when the first process wants to write
> but the second process is reading? 
SQLite has locking. See http://www.sqlite.org/lockingv3.html

Brad

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


[sqlite] System.Data.Sqlite extension function - performing INSERT

2012-06-29 Thread Brad Hards
Hi,

I'm trying to provide a not-really-spatialite toolset for C# users (since they 
often seem to have trouble with spatialite / extension loading).

No problem with SELECT from an existing database / table. However I'd like to 
provide the capability to perform an INSERT of a newly created geometry into 
an existing spatialite geometry column. I can do that if there isn't an index.

If there is an index, then the insertion will invoke triggers to update the 
RTree index table. Those triggers use two SQL functions that are provided by 
libspatialite - GeometryConstraints() and RTreeAlign(). I don't have 
libspatialite in this example, so I need to provide those functions myself.

GeometryConstraints() is no problem.

RTreeAlign is OK up to the point where I need to actually update the index 
table. Now I'm stuck because I don't have access to the connection.

http://system.data.sqlite.org/index.html/annotate?checkin=2849c1b71384d52d&filename=System.Data.SQLite/SQLiteFunction.cs
 
indicates that this is intentional:
ec237b0123 2005-03-01 rmsimpson:   /// Although there is one instance of a 
class derived from SQLiteFunction per database connection, the derived class 
has no access
ec237b0123 2005-03-01 rmsimpson:   /// to the underlying connection.  This 
is necessary to deter implementers from thinking it would be a good idea to 
make database
ec237b0123 2005-03-01 rmsimpson:   /// calls during processing.

I can read that two ways:
1. Most implementers aren't smart enough to get that right (probably true in 
my case).
2. No-one is smart enough to get that right - its a "Here Be Dragons" place.

However, I still need to do it (or toss the code onto the "nice idea at the 
time" scrapheap).

Is there a workaround to get at the underlying connection from my extension 
function class?

Is there anything to be aware of in implementing a "SQLiteFunction2" that does 
allow access to the underlying connection?

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