Re: [sqlite] Check Constraint

2018-06-12 Thread Cecil Westerhof
2018-06-12 12:38 GMT+02:00 Clemens Ladisch : > Cecil Westerhof wrote: > > I want to create a field that only has values that consist of letters, > > numbers end '-'. So no spaces, quotes or special characters like: '@%$!'. > > What is the best way to write this check constraint? > > The GLOB

Re: [sqlite] Performance of writing blobs

2018-06-12 Thread Dominique Devienne
On Tue, Jun 12, 2018 at 12:49 PM Clemens Ladisch wrote: > Dominique Devienne wrote: > > In JOURNAL mode, new data goes to DB file directly, and modified pages > go to the JOURNAL file. > > And since here this is INSERT-only, from empty tables, I assumed pages > copied to the JOURNAL > > file

[sqlite] Check Constraint

2018-06-12 Thread Cecil Westerhof
I want to create a field that only has values that consist of letters, numbers end '-'. So no spaces, quotes or special characters like: '@%$!'. What is the best way to write this check constraint? -- Cecil Westerhof ___ sqlite-users mailing list

Re: [sqlite] Check Constraint

2018-06-12 Thread Clemens Ladisch
Cecil Westerhof wrote: > I want to create a field that only has values that consist of letters, > numbers end '-'. So no spaces, quotes or special characters like: '@%$!'. > What is the best way to write this check constraint? The GLOB operator has inverted character classes. So the field is

Re: [sqlite] Check Constraint

2018-06-12 Thread David Burgess
my guess check( your_col NOT GLOB '[@%$!]" ' ) On Tue, Jun 12, 2018 at 7:50 PM, Cecil Westerhof wrote: > I want to create a field that only has values that consist of letters, > numbers end '-'. So no spaces, quotes or special characters like: '@%$!'. > What is the best way to write this check

Re: [sqlite] Performance of writing blobs

2018-06-12 Thread Dominique Devienne
On Tue, Jun 12, 2018 at 8:03 AM Clemens Ladisch wrote: > Dominique Devienne wrote: > > On Mon, Jun 11, 2018 at 4:27 PM Clemens Ladisch > wrote: > >> It does write to the same pages, but those pages must be copied to the > >> rollback journal so that they can be restored if the transaction is >

Re: [sqlite] Performance of writing blobs

2018-06-12 Thread Clemens Ladisch
Dominique Devienne wrote: > On Mon, Jun 11, 2018 at 4:27 PM Clemens Ladisch wrote: >> It does write to the same pages, but those pages must be copied to the >> rollback journal so that they can be restored if the transaction is >> rolled back. (Or are the two passes inside the same transaction?)

Re: [sqlite] Performance of writing blobs

2018-06-12 Thread Clemens Ladisch
Dominique Devienne wrote: > In JOURNAL mode, new data goes to DB file directly, and modified pages go to > the JOURNAL file. > And since here this is INSERT-only, from empty tables, I assumed pages copied > to the JOURNAL > file should be minimal. Yes. You can check the journal size with

Re: [sqlite] Trigger Performance

2018-06-12 Thread Space Pixel
Hello SQLite, I am having serious truble with SQLite3 in Node.js (the NPM package). The code uses deprecated packages (such as crypto, http, https, aws-sdk) and when I try to fix some of the (mostly) fixable problems, the console shows a warning, about an inappropriate loader to some C# file. If

[sqlite] How to convert SQL file into database when a column value is Inf?

2018-06-12 Thread skywind mailing lists
Hi, I issued the following commands: echo .dump | sqlite3 Database.sldb > D.sldb sqlite3 -init D.sldb NewDatabase.sldb Unfortunately, reading the SQL file produced the following error: Error: near line 56721: no such column: Inf The corresponding SQL command is: INSERT INTO "Flights"

Re: [sqlite] Database is malformed but no further information

2018-06-12 Thread Chris Brody
My understanding is that mobile apps are not 100% predictable since they may be randomly suspended or terminated, at any point of time. The operating system should give a signal before suspending or terminating but I would not trust it. Goes for Android, iOS, Windows Mobile, and others. To be

Re: [sqlite] Possible Input Parser Issue Inf How to convert SQL file into database when a column value is Inf?

2018-06-12 Thread Chris Brody
On Tue, Jun 12, 2018 at 6:40 PM Richard Hipp wrote: > [...] > Maybe use 1e999 and -1e999 instead? I can confirm on SQLite versions 3.19.2 & 3.24.0: sqlite> select 1e999; Inf sqlite> select -1e999; -Inf I wouldn't mind it if SQLite would be a little more symmetrical, i.e. output of .dump with

Re: [sqlite] How to convert SQL file into database when a column value is Inf?

2018-06-12 Thread R Smith
On 2018/06/13 12:21 AM, skywind mailing lists wrote: Hi, the original database is malformed. So, I cannot access it anymore besides doing a dump. There is currently no known way to read this since Inf and -Inf are not recognized as floats but in stead look like identifiers. Perhaps this is

Re: [sqlite] Database is malformed but no further information

2018-06-12 Thread Simon Slavin
On 12 Jun 2018, at 11:20pm, skywind mailing lists wrote: > when I load my database into sqlite3 and run an integrity check I only get > the error message: Error: database disk image is malformed > > I do not get any further information. What causes this simple error message? It means that

Re: [sqlite] Possible Input Parser Issue Inf How to convert SQL file into database when a column value is Inf?

2018-06-12 Thread Abroży Nieprzełoży
or .dump should produce output with 1e999 / -1e999 instead of Inf / -Inf 2018-06-13 1:11 GMT+02:00, Chris Brody : > On Tue, Jun 12, 2018 at 6:40 PM Richard Hipp wrote: >> [...] >> Maybe use 1e999 and -1e999 instead? > > I can confirm on SQLite versions 3.19.2 & 3.24.0: > > sqlite> select 1e999;

[sqlite] Possible Input Parser Issue Inf How to convert SQL file into database when a column value is Inf?

2018-06-12 Thread Keith Medcalf
The tip of trunk also does not parse "Inf" or "-Inf" floating point values (eg: in an insert statement), but will produce Inf and -Inf output. The bind and column values interfaces however do handle the IEEE inf/-inf correctly. Is this a bug/oversight in the parser? sqlite> create table x(x

Re: [sqlite] How to convert SQL file into database when a column value is Inf?

2018-06-12 Thread Keith Medcalf
You can replace the "Inf" with 1e400 and -Inf with -1e400. These values will be parsed and stored as the appropriate plus/minus Infinity since they are larger than the maximum representable IEEE-754 Double Precision Binary Float. --- The fact that there's a Highway to Hell but only a Stairway

Re: [sqlite] Possible Input Parser Issue Inf How to convert SQL file into database when a column value is Inf?

2018-06-12 Thread Richard Hipp
On 6/12/18, Keith Medcalf wrote: > > The tip of trunk also does not parse "Inf" or "-Inf" floating point values Maybe use 1e999 and -1e999 instead? -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

[sqlite] Database is malformed but no further information

2018-06-12 Thread skywind mailing lists
Hi, when I load my database into sqlite3 and run an integrity check I only get the error message: Error: database disk image is malformed I do not get any further information. What causes this simple error message? I expected to get some more information what is actually the reason why SQLite3

Re: [sqlite] How to convert SQL file into database when a column value is Inf?

2018-06-12 Thread skywind mailing lists
Hi Keith, thanks for the suggestion. Regards, Hartwig > Am 2018-06-13 um 00:26 schrieb Keith Medcalf : > > > You can replace the "Inf" with 1e400 and -Inf with -1e400. These values will > be parsed and stored as the appropriate plus/minus Infinity since they are > larger than the maximum

Re: [sqlite] How to convert SQL file into database when a column value is Inf?

2018-06-12 Thread Bob Friesenhahn
On Wed, 13 Jun 2018, skywind mailing lists wrote: A workaround is of course to use a text editor and try to find and replace all occurrences of Inf or -Info. Can you use update queries on the original database to change the Inf and -Inf values to huge positive or negative values that sqlite

[sqlite] Creating a new virtual table error "no such module $VTAB_MODULE_NAME" error

2018-06-12 Thread siscia
Hi All, I am facing a quite interesting problem. I am trying to implement a new virtual table, everything seems alright, I receive SQLITE_OK code on the registration but as soon as I try to use the vtab that I just created I only get an error: "no such module: $NAME_VTAB" It seems to me that I

Re: [sqlite] How to convert SQL file into database when a column value is Inf?

2018-06-12 Thread skywind mailing lists
Hi, the original database is malformed. So, I cannot access it anymore besides doing a dump. Regards, Hartwig > Am 2018-06-13 um 00:17 schrieb Bob Friesenhahn : > > On Wed, 13 Jun 2018, skywind mailing lists wrote: >> >> A workaround is of course to use a text editor and try to find and

Re: [sqlite] Trigger Performance

2018-06-12 Thread Simon Slavin
On 12 Jun 2018, at 10:49am, Space Pixel wrote: > the console > shows a warning, about an inappropriate loader to some C# file. There is no C# code in SQLite. It's all plain C. Can you show us the error message and tell us how it relates to you using SQLite commands ? Simon.

Re: [sqlite] Trigger Performance

2018-06-12 Thread Space Pixel
I'll try to do whatever I can. On Tue, Jun 12, 2018, 8:10 PM Simon Slavin wrote: > On 12 Jun 2018, at 10:49am, Space Pixel wrote: > > > the console > > shows a warning, about an inappropriate loader to some C# file. > > There is no C# code in SQLite. It's all plain C. Can you show us the >

Re: [sqlite] Performance of writing blobs

2018-06-12 Thread Eduardo Morras
On Tue, 12 Jun 2018 14:13:33 +0200 Dominique Devienne wrote: > > You're right of course. Thank you Clemens. > > With synchronous = OFF, which suits my use-case here, the commit-time > just vanishes, > and even out-performs HDF5 now (see below). I might still prefer HDF5, > mainly because > the