Re: [sqlite] Using a customized collate function to mimic integer array type.

2014-03-21 Thread James K. Lowden
On Fri, 21 Mar 2014 09:35:19 -0500
Ben Peng  wrote:

> I have an application where data stored in columns can be lists of
> integers (e.g. 158;42;76). I cannot really split such record into
> multiple records (one for 158, one for 42 etc) and I am currently
> storing them as VARCHAR because they represent a complete piece of
> information. However, when I select records, I would like to compare
> or match any of the values. 

In relational terms, your column with "158;42;76" is not in 1NF.

You want to match "any" of the values: an OR condition.  That
tells you they are distinct, and should each be on their own row, viz., 

158;42;76   158
158;42;7642
158;42;7676

Create a table like that, and join it to the one you have.  

Someone else mentioned using a VTF to accomplish that on the fly.  That
would work, too.  A better solution (that is not a SQLite feature yet)
would be a table-valued function.  

Today, SQLite supports two kinds of functions, scalar and aggregate.
Using R for the number of rows and C for the number of columns, these
can be described as

Scalar:  1 x C -> 1 x 1 output
Aggregate: R x C  -> 1 x 1 output 

A table-valued function is

Table: R x C -> N x M output

which looks a lot like an ordinary join, doesn't it?  

IOW, there's no fixed relationship between the number of input rows and
columns, and the number of output rows and columns.  Using your
example, 

Example: R x 1 -> 3R x 2

and your SQL becomes

select t.*, tf.output
from existing_table as t 
join tf(t.values) as tf
on t.values = tf.values;

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


Re: [sqlite] How good is pragma integrity_check

2014-03-21 Thread Simon Slavin

On 21 Mar 2014, at 7:57pm, Roger Binns  wrote:

> It also doesn't check the data, just the structure of the data.  There was
> a feature request ticket for several years for checksums to at least catch
> unexpected changes to the data itself:
> 
>  https://www.sqlite.org/src/tktview?name=72b01a982a
> 
> Sadly it was rejected a few weeks ago without explanation.

There are problems with the particular formulation of checksums described in 
that ticket.  It will miss corruption caused the majority of faults which will 
corrupt a database.

Checksums stored with the page index lists, and then a checksum (of checksums 
?) across the whole table or index would be an improvement, and would involve 
the minimum slow-down caused by the additional work and storage required.  
Nevertheless, the basic SQLite engine is so efficient that any slow-down would 
be noticed and might cause complaints.

I suspect that the transition to SQLite4 is the first practical chance to 
introduce checksums.

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


Re: [sqlite] Using a customized collate function to mimic integer array type.

2014-03-21 Thread Max Vlasov
On Fri, Mar 21, 2014 at 8:06 PM, Ben Peng  wrote:
>
> I guess I will have to take the longer route, namely define a customized
> comparison function and translate user input internally.
>

There's an also virtual table method, probably not so easy to wrap the
head around, but this one allows using comma (or other symbols
splitted) lists stored in fields even in joins. See my reply about it
at https://www.mail-archive.com/sqlite-users@sqlite.org/msg63453.html.

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


Re: [sqlite] How good is pragma integrity_check

2014-03-21 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 20/03/14 18:06, Simon Slavin wrote:
> All useful as far as SQLite itself goes, and better than nothing.
> Unfortunately, failing hard disks do weird things in weird orders.  And
> the interaction between the physical hard disk and the on-board cache
> makes it impossible to find out what's really on the disk.  There's
> only one way to check whether the whole file is readable from a disk:
> read the whole file from the disk.  Then do an integrity check on the
> copy you just made.

It also doesn't check the data, just the structure of the data.  There was
a feature request ticket for several years for checksums to at least catch
unexpected changes to the data itself:

  https://www.sqlite.org/src/tktview?name=72b01a982a

Sadly it was rejected a few weeks ago without explanation.

Roger

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.14 (GNU/Linux)

iEYEARECAAYFAlMsmbQACgkQmOOfHg372QQy5gCfVa599WN9XWUB1Q8ABKYPJmQ6
QBwAnjuHzmK2oGfnhHDqdjlhD/5CoYe/
=1Y2C
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Using a customized collate function to mimic integer array type.

2014-03-21 Thread Ben Peng
Thanks Dan,

I think I get your point. COLLATE not only provides a new way to compare
values (what is what I need), but also gives new appearances to existing
values by which they are sorted or grouped. So 158;42;76 can not appear as
158, 42, and 76 at the same time (158;42;76 == 42, 158;42;76 == 76, does
not imply 42 == 76).

I guess I will have to take the longer route, namely define a customized
comparison function and translate user input internally.

Thanks again for all the help, I am glad that I asked before I write any
code.

Bo



On Fri, Mar 21, 2014 at 10:44 AM, Dan Kennedy  wrote:

> On 03/21/2014 10:33 PM, Ben Peng wrote:
>
>> Hi, Tristan,
>>
>> Your solution definitely works (we have defined a few custom functions)
>> but
>> our application hides databases from users but allows users to use simple
>> conditions to retrieve results. To use this function, we would have to
>>
>> 1. teach users use this function, which is hard to do because it is
>> application specific and they need to know which fields need to use this
>> function.
>>
>> 2. translate user input to use this function internally. We will need to
>> use a separate table to record the fields that need translation, and
>> change
>> user input accordingly.
>>
>> A COLLATE function seems to mark the columns directly and save us from the
>> trouble of translating user input, so it might be a better solution in
>> this
>> case.
>>
>
> SQLite assumes that collation sequences are internally consistent. From
> the docs:
>
>  1. If A==B then B==A.
>  2. If A==B and B==C then A==C.
>  3. If AA.
>  4. If A
> But this would not be true of the proposed collation sequence. So although
> some queries will appear to work, you'll be in trouble if SQLite ever
> decides to create an automatic index based on the collation sequence. Or if
> anybody ever uses an ORDER BY or GROUP BY clause that uses it. Various
> other problems can likely arise if the optimizer starts commuting
> expressions and so on, which it sometimes does.
>
> Of course I don't know exactly what kinds of queries you are expecting,
> but this seems like the kind of thing that will come back and bite you to
> me.
>
> Dan.
>
>
>
>  On Fri, 2014-03-21 at 09:35 -0500, Ben Peng wrote:
>>>
 Dear sqlite experts,

>>> I'm far from an "sqlite expert", others should be able to
>>> provide a more authoritive answer
>>>
>>> I think what you want is rather to simply define your own custom
>>> function to implement a custom match.
>>>
>>> I think using COLLATE is wrong in this case, because the use case of
>>> COLLATE is generally to implement ORDER BY, or perhaps to build a custom
>>> index (to replace the regular strcmp() like behavior) but what you want
>>> is a rather loose matching algorithm.
>>>
>>> If you create a function using sqlite3_create_function(), similar to how
>>> you might define a REGEX function, you might execute a query with:
>>>
>>>SELECT * FROM table WHERE custom_match (table.column, 42) = 0;
>>>
>>> And then, lets assume that "custom_match" uses sqlite3_result_int()
>>> to set the result to 0 if there is a match, or -1 if there is no match,
>>> then you should get a match for any row where table.column = 158;42;76
>>>
>>> You can of course give more parameters to "custom_match", so that you
>>> can use invocations like this:
>>>custom_match (GREATER, table.column, 42)
>>>custom_match (EQUALS, table.column, 42)
>>>custom_match (LESSER, table.column, 42)
>>>
>>> Make sense ?
>>>
>>> Cheers,
>>>  -Tristan
>>>
>>>  I have an application where data stored in columns can be lists of

>>> integers
>>>
 (e.g. 158;42;76). I cannot really split such record into multiple
 records
 (one for 158, one for 42 etc) and I am currently storing them as VARCHAR
 because they represent a complete piece of information. However, when I
 select records, I would like to compare or match any of the values. For
 example, the record could be selected by either

 C > 100 (match 158)
 C < 100 (match 42 and 76)
 C = 42 (match 42)

  From what I have read so far, I could define a special collate function

>>> for
>>>
 these columns (sqlite3_create_collation etc), but before I jump into the
 details, does anyone know

 1. Is this the correct way to proceed?
 2. Has anyone done anything similar so that I do not have to reinvent
 the
 wheel?

 Thank you very much,
 Bo
 ___
 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
>> 

Re: [sqlite] Using a customized collate function to mimic integer array type.

2014-03-21 Thread Dan Kennedy

On 03/21/2014 10:33 PM, Ben Peng wrote:

Hi, Tristan,

Your solution definitely works (we have defined a few custom functions) but
our application hides databases from users but allows users to use simple
conditions to retrieve results. To use this function, we would have to

1. teach users use this function, which is hard to do because it is
application specific and they need to know which fields need to use this
function.

2. translate user input to use this function internally. We will need to
use a separate table to record the fields that need translation, and change
user input accordingly.

A COLLATE function seems to mark the columns directly and save us from the
trouble of translating user input, so it might be a better solution in this
case.


SQLite assumes that collation sequences are internally consistent. From 
the docs:


 1. If A==B then B==A.
 2. If A==B and B==C then A==C.
 3. If AA.
 4. If ABut this would not be true of the proposed collation sequence. So 
although some queries will appear to work, you'll be in trouble if 
SQLite ever decides to create an automatic index based on the collation 
sequence. Or if anybody ever uses an ORDER BY or GROUP BY clause that 
uses it. Various other problems can likely arise if the optimizer starts 
commuting expressions and so on, which it sometimes does.


Of course I don't know exactly what kinds of queries you are expecting, 
but this seems like the kind of thing that will come back and bite you 
to me.


Dan.



On Fri, 2014-03-21 at 09:35 -0500, Ben Peng wrote:

Dear sqlite experts,

I'm far from an "sqlite expert", others should be able to
provide a more authoritive answer

I think what you want is rather to simply define your own custom
function to implement a custom match.

I think using COLLATE is wrong in this case, because the use case of
COLLATE is generally to implement ORDER BY, or perhaps to build a custom
index (to replace the regular strcmp() like behavior) but what you want
is a rather loose matching algorithm.

If you create a function using sqlite3_create_function(), similar to how
you might define a REGEX function, you might execute a query with:

   SELECT * FROM table WHERE custom_match (table.column, 42) = 0;

And then, lets assume that "custom_match" uses sqlite3_result_int()
to set the result to 0 if there is a match, or -1 if there is no match,
then you should get a match for any row where table.column = 158;42;76

You can of course give more parameters to "custom_match", so that you
can use invocations like this:
   custom_match (GREATER, table.column, 42)
   custom_match (EQUALS, table.column, 42)
   custom_match (LESSER, table.column, 42)

Make sense ?

Cheers,
 -Tristan


I have an application where data stored in columns can be lists of

integers

(e.g. 158;42;76). I cannot really split such record into multiple records
(one for 158, one for 42 etc) and I am currently storing them as VARCHAR
because they represent a complete piece of information. However, when I
select records, I would like to compare or match any of the values. For
example, the record could be selected by either

C > 100 (match 158)
C < 100 (match 42 and 76)
C = 42 (match 42)

 From what I have read so far, I could define a special collate function

for

these columns (sqlite3_create_collation etc), but before I jump into the
details, does anyone know

1. Is this the correct way to proceed?
2. Has anyone done anything similar so that I do not have to reinvent the
wheel?

Thank you very much,
Bo
___
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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Using a customized collate function to mimic integer array type.

2014-03-21 Thread Ben Peng
Hi, Tristan,

Your solution definitely works (we have defined a few custom functions) but
our application hides databases from users but allows users to use simple
conditions to retrieve results. To use this function, we would have to

1. teach users use this function, which is hard to do because it is
application specific and they need to know which fields need to use this
function.

2. translate user input to use this function internally. We will need to
use a separate table to record the fields that need translation, and change
user input accordingly.

A COLLATE function seems to mark the columns directly and save us from the
trouble of translating user input, so it might be a better solution in this
case.

Thanks,
Bo



On Fri, Mar 21, 2014 at 10:05 AM, Tristan Van Berkom <
tris...@upstairslabs.com> wrote:

> On Fri, 2014-03-21 at 09:35 -0500, Ben Peng wrote:
> > Dear sqlite experts,
>
> I'm far from an "sqlite expert", others should be able to
> provide a more authoritive answer
>
> I think what you want is rather to simply define your own custom
> function to implement a custom match.
>
> I think using COLLATE is wrong in this case, because the use case of
> COLLATE is generally to implement ORDER BY, or perhaps to build a custom
> index (to replace the regular strcmp() like behavior) but what you want
> is a rather loose matching algorithm.
>
> If you create a function using sqlite3_create_function(), similar to how
> you might define a REGEX function, you might execute a query with:
>
>   SELECT * FROM table WHERE custom_match (table.column, 42) = 0;
>
> And then, lets assume that "custom_match" uses sqlite3_result_int()
> to set the result to 0 if there is a match, or -1 if there is no match,
> then you should get a match for any row where table.column = 158;42;76
>
> You can of course give more parameters to "custom_match", so that you
> can use invocations like this:
>   custom_match (GREATER, table.column, 42)
>   custom_match (EQUALS, table.column, 42)
>   custom_match (LESSER, table.column, 42)
>
> Make sense ?
>
> Cheers,
> -Tristan
>
> >
> > I have an application where data stored in columns can be lists of
> integers
> > (e.g. 158;42;76). I cannot really split such record into multiple records
> > (one for 158, one for 42 etc) and I am currently storing them as VARCHAR
> > because they represent a complete piece of information. However, when I
> > select records, I would like to compare or match any of the values. For
> > example, the record could be selected by either
> >
> > C > 100 (match 158)
> > C < 100 (match 42 and 76)
> > C = 42 (match 42)
> >
> > From what I have read so far, I could define a special collate function
> for
> > these columns (sqlite3_create_collation etc), but before I jump into the
> > details, does anyone know
> >
> > 1. Is this the correct way to proceed?
> > 2. Has anyone done anything similar so that I do not have to reinvent the
> > wheel?
> >
> > Thank you very much,
> > Bo
> > ___
> > 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] Using a customized collate function to mimic integer array type.

2014-03-21 Thread Tristan Van Berkom
On Fri, 2014-03-21 at 09:35 -0500, Ben Peng wrote:
> Dear sqlite experts,

I'm far from an "sqlite expert", others should be able to
provide a more authoritive answer

I think what you want is rather to simply define your own custom
function to implement a custom match.

I think using COLLATE is wrong in this case, because the use case of
COLLATE is generally to implement ORDER BY, or perhaps to build a custom
index (to replace the regular strcmp() like behavior) but what you want
is a rather loose matching algorithm.

If you create a function using sqlite3_create_function(), similar to how
you might define a REGEX function, you might execute a query with:

  SELECT * FROM table WHERE custom_match (table.column, 42) = 0;

And then, lets assume that "custom_match" uses sqlite3_result_int()
to set the result to 0 if there is a match, or -1 if there is no match,
then you should get a match for any row where table.column = 158;42;76

You can of course give more parameters to "custom_match", so that you
can use invocations like this:
  custom_match (GREATER, table.column, 42)
  custom_match (EQUALS, table.column, 42)
  custom_match (LESSER, table.column, 42)

Make sense ?

Cheers,
-Tristan

> 
> I have an application where data stored in columns can be lists of integers
> (e.g. 158;42;76). I cannot really split such record into multiple records
> (one for 158, one for 42 etc) and I am currently storing them as VARCHAR
> because they represent a complete piece of information. However, when I
> select records, I would like to compare or match any of the values. For
> example, the record could be selected by either
> 
> C > 100 (match 158)
> C < 100 (match 42 and 76)
> C = 42 (match 42)
> 
> From what I have read so far, I could define a special collate function for
> these columns (sqlite3_create_collation etc), but before I jump into the
> details, does anyone know
> 
> 1. Is this the correct way to proceed?
> 2. Has anyone done anything similar so that I do not have to reinvent the
> wheel?
> 
> Thank you very much,
> Bo
> ___
> 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] Using a customized collate function to mimic integer array type.

2014-03-21 Thread Ben Peng
Dear sqlite experts,

I have an application where data stored in columns can be lists of integers
(e.g. 158;42;76). I cannot really split such record into multiple records
(one for 158, one for 42 etc) and I am currently storing them as VARCHAR
because they represent a complete piece of information. However, when I
select records, I would like to compare or match any of the values. For
example, the record could be selected by either

C > 100 (match 158)
C < 100 (match 42 and 76)
C = 42 (match 42)

>From what I have read so far, I could define a special collate function for
these columns (sqlite3_create_collation etc), but before I jump into the
details, does anyone know

1. Is this the correct way to proceed?
2. Has anyone done anything similar so that I do not have to reinvent the
wheel?

Thank you very much,
Bo
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Trigger to another database

2014-03-21 Thread Clemens Ladisch
SQlite Sqlite wrote:
> I try to write a trigger in db1 which inserts data to a table in db2.

Triggers are not allowed to access other databases because those might
not be attached.

> is there a workournd to synchronize two tables between different databases?

Your program could register a user-defined function and call that from
the trigger.


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


Re: [sqlite] System.Data.SQLite Deployment Mystery

2014-03-21 Thread dpybus
Dear Joe,

 

Thank you for your helpful comments. I’ve finally got it going on ‘naïve’
Win 8 (and Win 7) computers, but I don’t understand why!!

 

In short, I got it going by adopting the technique described here:

 

http://rashimuddin.wordpress.com/tag/sqlite-interop-dll/

 

Perhaps you can suggest why this has worked?

 

Yours Sincerely,

 

Andy Pybus

 

 

From: Joe Mistachkin-3 [via SQLite]
[mailto:ml-node+s1065341n74574...@n5.nabble.com] 
Sent: Monday, 17 March 2014 3:35 PM
To: dpybus
Subject: Re: System.Data.SQLite Deployment Mystery

 


dpybus wrote: 
> 
> I have an identical problem. I cannot deploy an app which uses either Net 
4.5 
> or 4.5.1 with the appropriate sqlite dll. It can be fixed by installing 
the 
> sqlite package on the target computer. 
> 

Generally, there are three types of issues with System.Data.SQLite 
deployment: 

1.  Attempting to use the native interop assembly (or native library) 
without 
the necessary Microsoft Visual C++ Runtime Libraries installed. 

2.  Attempting to use the 32-bit native interop assembly (or native library)

in a 64-bit process or vice-versa. 

3.  Loading the managed-only System.Data.SQLite assembly in such a way that 
it 
cannot locate its associated native interop assembly (or native 
library). 
With the introduction [and refinement] of the "native library 
pre-loading" 
feature, this frequency of this issue has declined significantly.  One 
way 
to see this type of issue is to install the managed-only 
System.Data.SQLite 
assembly in the GAC without making the associated native interop 
assembly 
available somewhere in the PATH. 

In this case, I suspect the problem is #1.  Running the free Dependency 
Walker 
tool (from http://dependencywalker.com/ ) against the native interop 
assembly 
("SQLite.Interop.dll") on the target machine should reveal if that is the 
case. 

If that does turn out to be the case, it can normally be solved by 
installing 
one of the packages from: 

https://support.microsoft.com/kb/2019667

-- 
Joe Mistachkin 

___ 
sqlite-users mailing list 
[hidden email] 
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



  _  

If you reply to this email, your message will be added to the discussion
below:

http://sqlite.1065341.n5.nabble.com/System-Data-SQLite-Deployment-Mystery-tp
71752p74574.html 

To unsubscribe from System.Data.SQLite Deployment Mystery, click here
 .
 
 NAML 





--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/System-Data-SQLite-Deployment-Mystery-tp71752p74660.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] System.Data.SQLite Deployment Mystery

2014-03-21 Thread dpybus
Dear Markus,

 

Thank you for your helpful comments. I’ve finally got it going on ‘naïve’
Win 8 (and Win 7) computers, but I don’t understand why!!

 

In short, I got it going by adopting the technique described here:

 

http://rashimuddin.wordpress.com/tag/sqlite-interop-dll/

 

Perhaps you can suggest why this has worked?

 

Yours Sincerely,

 

Andy Pybus

 

 

From: Markus Schaber [via SQLite]
[mailto:ml-node+s1065341n74581...@n5.nabble.com] 
Sent: Monday, 17 March 2014 9:55 PM
To: dpybus
Subject: Re: System.Data.SQLite Deployment Mystery

 

Hi, 

Von: [hidden email] [mailto:[hidden email]] 


> 
> dpybus wrote: 
> > 
> > I have an identical problem. I cannot deploy an app which uses either 
> > Net 
> 4.5 
> > or 4.5.1 with the appropriate sqlite dll. It can be fixed by 
> > installing 
> the 
> > sqlite package on the target computer. 
> > 
> 
> Generally, there are three types of issues with System.Data.SQLite 
> deployment: 
> 
> 1.  Attempting to use the native interop assembly (or native library)
without 
> the necessary Microsoft Visual C++ Runtime Libraries installed. 
> 
> 2.  Attempting to use the 32-bit native interop assembly (or native
library) 
> in a 64-bit process or vice-versa. 
> 
> 3.  Loading the managed-only System.Data.SQLite assembly in such a way
that it 
> cannot locate its associated native interop assembly (or native
library). 
> With the introduction [and refinement] of the "native library
pre-loading" 
> feature, this frequency of this issue has declined significantly. One
way 
> to see this type of issue is to install the managed-only
System.Data.SQLite 
> assembly in the GAC without making the associated native interop
assembly 
> available somewhere in the PATH. 


SharpSVN (https://sharpsvn.open.collab.net/) uses some build trickery to
link 
native libraries in a way that they're kept as "external resource files"
along 
with the assembly. This means that VS and MSBuild copy them along with the
main 
assembly, and it is also installed into the GAC along with the main
assembly. 

The trick seems to be the  tag below in the vcxproj
file: 

 
 
Advapi32.lib;shell32.lib;Rpcrt4.lib;Mswsock.lib;Cryp
t32.lib;User32.lib 
 
..\..\imports\release\lib;..\..\imports\releas
e\lib-AnyCPU;..\..\imports\release\bin;%(AdditionalLibraryDirectories) 
 
SharpSvn-DB44-20-$(Platform).svnDll;crypt32.dll;mswsock.dll;s
ecur32.dll;user32.dll;ole32.dll;advapi32.dll;%(DelayLoadDLLs) 
 
$(TargetDir)SharpSvn-DB44-20-$(Platform).svnDll;$(Targ
etDir)SharpPlink-$(Platform).svnExe;%(AssemblyLinkResource) 
  true 
  true 
  MachineX86 
  SharpSvn.snk 
 
UseLinkTimeCodeGeneration 
  true 
 

It links both a DLL and an exe file that way. (The file endings are changed
to reduce confusion of other software.) 

When installing into the GAC, they both are copied along into the same
directory as the SharpSVN Assembly itsself, where they can be found and
loaded / executed. 

Maybe this trick could be used by System.Data.SQLlite as well - however, I'm
currently not sure whether it is possible to create such linkage with C#,
maybe some postprocessing is necessary. 

On the other hand, SharpSVN also links a lot of native code directly into
the DLL - using C++/CLI instead of C#, this is rather easy. 

Best regards 

Markus Schaber 

CODESYS(r) a trademark of 3S-Smart Software Solutions GmbH 

Inspiring Automation Solutions 

3S-Smart Software Solutions GmbH 
Dipl.-Inf. Markus Schaber | Product Development Core Technology 
Memminger Str. 151 | 87439 Kempten | Germany 
Tel. +49-831-54031-979 | Fax +49-831-54031-50 

E-Mail: [hidden email] | Web: http://www.codesys.com | CODESYS store:
http://store.codesys.com
CODESYS forum: http://forum.codesys.com

Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade
register: Kempten HRB 6186 | Tax ID No.: DE 167014915 
___ 
sqlite-users mailing list 
[hidden email] 
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



  _  

If you reply to this email, your message will be added to the discussion
below:

http://sqlite.1065341.n5.nabble.com/System-Data-SQLite-Deployment-Mystery-tp
71752p74581.html 

To unsubscribe from System.Data.SQLite Deployment Mystery, click here
 .
 
 NAML 





--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/System-Data-SQLite-Deployment-Mystery-tp71752p74659.html
Sent from the SQLite mailing 

Re: [sqlite] How good is pragma integrity_check

2014-03-21 Thread Tim Streater
On 21 Mar 2014 at 01:06, Simon Slavin  wrote: 

> On 20 Mar 2014, at 11:33pm, Richard Hipp  wrote:
>
>> On Thu, Mar 20, 2014 at 7:18 PM, Tim Streater  wrote:
>>
>>> I had a case where attempts to access a table in a user's db gave "no such
>>> table", where 60 mins previously (according to the log) querying that table
>>> gave no problems. About a day and a half later the user's machine had what
>>> he described as a "bad crash", so I'm suspecting he has a failing disk.
>>> [snip]
>>
>> PRAGMA integrity_check catches most things.  PRAGMA quick_check also does a
>> good job, and it is much faster.  The only difference is that quick_check
>> does not verify that indices agree with tables, whereas a full
>> integrity_check does.
>
> All useful as far as SQLite itself goes, and better than nothing. 
> Unfortunately, failing hard disks do weird things in weird orders.  And the
> interaction between the physical hard disk and the on-board cache makes it
> impossible to find out what's really on the disk.  There's only one way to
> check whether the whole file is readable from a disk: read the whole file from
> the disk.  Then do an integrity check on the copy you just made.
>
> Practically speaking, it's impossible.  Concentrate on having really good
> backups instead.

Well quite. But although the question of backups is a matter for the user, as 
the software is on his machine, I'll probably beef up the startup checks and 
add periodic checks of each db (the app does some periodic checks anyway). I'm 
hoping the user will forward me his damaged db so I can use it for testing.



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