[sqlite] Mozilla wiki 'avoid SQLite'

2015-06-16 Thread Christopher Vance
With a relational model you have a choice between relational calculus or
relational algebra. SQL does one of them.

I have used a language which did the other, long ago in a land far away.

On Tue, Jun 16, 2015 at 9:56 AM,  wrote:

> >>>I think the best database language should reflect how earthlings think
> about the data, and the best computer programming language would reflect
> easily the result we want get from them.
>
> Care to expand on that?
>
> I'm developing a new database language: Andl. My starting point has been
> the
> relational model, Codd-Date-Darwen and The Third Manifesto.  My (only)
> competitor seems to be SQL, which has a 40+ year lead. Nothing like a
> challenge!
>
> The question is: what should a database language do? Andl can already match
> or surpass SQL on database programming tasks, but is that interesting
> enough?
>
> What would make a database programming better, or best?
>
> Regards
> David M Bennett FACS
>
> Andl - A New Database Language - andl.org
>
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Christopher Vance


[sqlite] User-defined types

2015-06-04 Thread Christopher Vance
If you really want your own types, you could always bundle with ASN.1 and
store the result as a blob.

On Thu, Jun 4, 2015 at 4:52 PM, Dominique Devienne 
wrote:

> On Thu, Jun 4, 2015 at 3:04 AM, Darko Volaric  wrote:
>
> > In my case I'm already modifying and maintaining my own version of
> SQLite.
> > [...]. The last time I brought these ideas up I was
> > practically chased off by a mob waving pitchforks and torches. Apparently
> > almost no-one thinks user defined types is a good idea so there is no
> point
> > sharing it. I don't expect anyone to help me maintain the code.
>
>
> FWIW,  I think UDTs are a great idea. But also
> - optional static typing of columns;
> - checksums of blocks;-
> - blob two-tier storage (a la Oracle);
> - native indexing of virtual table;
> - native JSON support;
> - etc...
>
> Yes, the community, just like the authors, of SQLite have a strong bias
> against changes and to keep SQLite "lite".
>
> And can be brutal in how they say it (or ignore it) when someone rants
> about his pet-peeves, or try to push forward his wish list (including me
> above).
>
> But remember that SQLite didn't have FKs for a long time. Didn't have CTE.
> Both of which are major enhancements. So there's hope long term IMHO :).
>
> Now unlike most (including me again), you go further and actually code it
> up apparently. That's great. But it's hard to fork SQLite and get any
> traction given the fast-paced refactoring/optimization the main code goes
> through. And also UDTs can have widespread side effects within SQLite, hard
> to gauge w/o having the whole code-base and design in ones head like DRH.
> Might be good enough for you, but not for the high quality standards which
> is a hallmark of SQLite IMHO. All I can suggest is continue communicating
> and perhaps also OSS your changes on GitHub or similar, and you may get
> help somehow.
>
> I suspect (hope really) first-class UDTs in SQLite (as Nico calls them)
> haven't been dismissed, and it's more a question of finding the time and
> funding to do them right, i.e. in a "lite" way that doesn't adversely
> affect SQLite if you don't use them, and thoroughly tested as usual. My
> $0.02. --DD
> _______
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Christopher Vance


[sqlite] How to insert a pointer data to sqlite?

2015-02-25 Thread Christopher Vance
Have you considered normalizing your database?

On Wed, Feb 25, 2015 at 12:07 PM, YAN HONG YE  wrote:

> I have a data:
> Id  pid namemark
> 1   0   f1  sample
> 2   1   f2  sample
> 3   1   f3  sample
> 4   2   f4  sample
> 5   2   *id(2).name *id(2).mark
>
> These means that under id(2) and id(5) have same node, if change one of
> the node, the other update auto,
> How to realize this function?
> Thank you!
>
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Christopher Vance


[sqlite] Is readline ubiquitous on 32-bit x86 Linux?

2015-02-25 Thread Christopher Vance
Or there's editline, used for some things as a partial readline substitute.

On Wed, Feb 25, 2015 at 5:12 AM, Andreas Kupries 
wrote:

> A possible (and small alternative) to readline would be Antirez
> "linenoise".
> Steve Bennet's fork adds windows portability and some other things.
>
> https://github.com/antirez/linenoise
> https://github.com/msteveb/linenoise
>
> That is small enough to be directly built as part of the shell, I believe.
>
>
>
> On Tue, Feb 24, 2015 at 10:01 AM, Dan Kennedy 
> wrote:
> >
> >
> > The pre-built sqlite3 shell tool for x86 Linux available for download
> here:
> >
> >   http://www.sqlite.org/download.html
> >
> > does not include readline support. Which makes it painful to use.
> >
> > Does anyone think that many systems would be affected if it dynamically
> > linked against the system readline? This means that the binary would not
> > work on systems without libreadline.so installed. Or is readline
> considered
> > ubiquitous by now?
> >
> > Dan.
> >
> >
> > ___
> > sqlite-users mailing list
> > sqlite-users at mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> --
> Andreas Kupries
> Senior Tcl Developer
> Code to Cloud: Smarter, Safer, Faster?
> F: 778.786.1133
> andreask at activestate.com, http://www.activestate.com
> Learn about Stackato for Private PaaS: http://www.activestate.com/stackato
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Christopher Vance


Re: [sqlite] UTF support

2014-10-07 Thread Christopher Vance
Actually, Unicode / ISO 10646 is a 21-bit encoding, with values from 0 to
0x10.

On Wed, Oct 8, 2014 at 10:13 AM, J Decker <d3c...@gmail.com> wrote:

> On Tue, Oct 7, 2014 at 2:20 PM, jose isaias cabrera <
> jic...@cinops.xerox.com
> > wrote:
>
> >
> > "J Decker" wrote...
> >
> >
> >  So, I guess it is technically not allowed to encode 11 bit unicode
> >> characters as 16.
> >> the greek characters are 0x3XX  which is 10 bits... I checked what
> >> WideCharToMultiByte was doing and found it was using 11 bit encodings...
> >> fixed my encoder to use an appropriate size for what's required, added
> 11
> >> bit decoding, and now in and out works for that and some chinese
> >> characters
> >> which are more than 11 bits.
> >>
> >> The 'unrecognized token' is 0xE0  ? ... although a thing could be 12
> bits
> >> exactly... so is it checking ( char[0] == 0xe0 ) && ( ( char[1] & 0xE0 )
> >> ==
> >> 0x80 )?
> >>
> >> as a side note.. using visual studio to mouse over the resulting char *
> >> string with 11 bit encodings it shows bad characters, if encoded as
> (valid
> >> but illegal) 16 bit it browses correctly.
> >>
> >
> > J,
> >
> > My suggestion is for you to read about ANSI, ASCII, UTF7, UTF8, UTF16 and
> > UTF32 and understand the ins and outs of the various encoding. You may
> need
> > to create your own wrapper to get things to work correctly.
> >
>
> Right; I did, and have, but missed the part 'must be encoded in least bits'
> (and I'm not sure it is there, and visual studio sees it as a valid thing
> to do; to use a encoding larger than the number of bits required)  and
> unicode only uses 20 bits max so the extended 5 and 6 byte utf-8 encodings
> never get used  Have a custom wrapper for systems that are not windows; and
> now it's more robust.
>
> Still think it's something of a bug, but has been worked around so for me
> it won't be an issue again.
>
>
>
> >
> > What happens if you create a text file using notepad and make sure that
> > you save it as UTF8 and then read that file with the content that you
> want?
> > Then write it to SQLite and get it back and write it back to another
> file?
> > Does that work?
> > ___
> > 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
>



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


Re: [sqlite] Using WHERE clauses with REAL data

2014-03-03 Thread Christopher Vance
There are a small number of floating point numbers which are almost always
exactly testable for equality, namely those you have confidence of exact
storage. Positive zero is good, although negative zero sometimes causes
problems; you can't always assume they're the same number. Smallish
integers multiplied or divided by smallish powers of two are probably okay,
so 3.25 is probably okay while 3.2501 and 52.3 are definitely not.
In most programming languages, if you want to check (near) equality of
floating point numbers you need to think about how many significant bits
you might have in the relevant mantissa, and check the absolute value of
the difference between what you have and what you're looking for, possibly
scaled for the exponent concerned.


On Tue, Mar 4, 2014 at 3:20 PM, Richard Hipp <d...@sqlite.org> wrote:

> On Mon, Mar 3, 2014 at 11:14 PM, Donald Shepherd
> <donald.sheph...@gmail.com>wrote:
>
> > It appears that using equals on floating point (REAL) data in WHERE
> clauses
> > doesn't necessarily work, presumably because of rounding errors - see
> below
> > for an example.  Is this the case?  Do I need to use BETWEEN instead of =
> > as I expect to be the case?
> >
>
> Never (well, almost never) use == with floating point numbers.  This rule
> applies to all systems, not just SQLite.
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] Timestamps from different timezones

2013-11-23 Thread Christopher Vance
You absolutely cannot do this automatically unless you know the source of
each timestamp, any maybe not even then. Just as a f'rinstance, there are
at least 3 different meanings for EST, and 2 of them are in the same
country: try -0500, +1000, +1100 for a start.


On 24 November 2013 10:53, Bernie Reiter <
bernie_on_the_road_ag...@yahoo.co.uk> wrote:

> Dear List,
>
> I receive data records from various sources. I can't influence their
> formats. These data records are containing datetimestamps like this
> (without the doublequotes):
>
> "06-May-12 18:57:41 BST"
> "Nov-22-13 22:58:10 PST"
> "23-Nov-13 08:56:57 GMT"
> "22.11.1300:33:32 MEZ"
> "23-Nov-13 18:57:40 AEDST"
> "23-Nov-13 01:58:10 EST"
>
> I want to automatically convert these datetimestamps into standard UTC.
>
> Currently I am using a "manual approach" by:
> a) converting the datetimestamp into the common format " -MM-DDTHH:MM"
> b) reading the time zone code (e.g., BST)
> c) looking-up the timezone indicator for this time zone code (e.g. -01:00)
> (see paragraph "Formats 2 through 10 may be optionally followed by a
> timezone indicator..."
> on page http://sqlite.org/lang_datefunc.html )
> d) and appending this indicator to an SQL statement.
>
> My SQL statements look like this:
> SELECT datetime('2012-05-06T18:57:41-01:00');
>
> Is there a clever way to convert these datetimestamps into standard UTC ?
>
>
> I don't want to "mess around" with the local timezone of the server
> on which sqlite3 is running. This approach is not portable.
>
> The Unix/Linux 'date' utility is not portable either.
>
> Thanks a lot
>
> bernie
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] SQlite Memory Leakage with 65536 Page Size

2013-10-26 Thread Christopher Vance
Whether and how you can do so will depend on what operating system you are
using.


On 27 October 2013 16:10, Raheel Gupta <raheel...@gmail.com> wrote:

> Hi,
>
> Yes, I tried Valgrind and it shows no leaks.
> But why would this happen with 64K pages ? In 1024 Sqlite is able to
> release all the memory.
>
> >> It might also be that your memory allocator is holding onto freed memory
> rather than releasing it back to the OS.
>
> How should I free it ?
>
>
>
> On Sun, Oct 27, 2013 at 9:46 AM, Richard Hipp <d...@sqlite.org> wrote:
>
> > On Sun, Oct 27, 2013 at 12:02 AM, Raheel Gupta <raheel...@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > Sir, if you see my first email, I have already tried that. When the 15
> > > Million records are being outputted, the ram usage shoots to a MAX of
> > > 126MB. After the "PRAGMA shrink_memory" it goes down to 65Mb but doesnt
> > go
> > > below that.
> > >
> > >
> > It might also be that your memory allocator is holding onto freed memory
> > rather than releasing it back to the OS.  Have you tried running with
> > valgrind to see it shows any leaks?
> >
> > --
> > 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
>



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


Re: [sqlite] Sqlite ubuntu 12.10 compile/install

2013-01-30 Thread Christopher Vance
C is not a subset of C++, although it has been close.

Do not compile C with a C++ compiler, or you'll discover one of the
bits where if fails.

-- Christopher

On 31 January 2013 07:27, David Clark <quincy...@yahoo.com> wrote:
> This has been resolved...solution:
> 1) use gcc not g++.
> 2) grab the lastest source from sqlite.org.  There was a version update in 
> doing that.  But now it seems good on both
> operating systems.
>
> Thank you,
>
> David Clark
>
>
>
>>
>> From: Michael Black <mdblac...@yahoo.com>
>>To: 'David Clark' <quincy...@yahoo.com>; 'General Discussion of SQLite 
>>Database' <sqlite-users@sqlite.org>
>>Sent: Wednesday, January 30, 2013 9:30 AM
>>Subject: RE: [sqlite] Sqlite ubuntu 12.10 compile/install
>>
>>Use the amalgamation:
>>
>>cc -O -c sqlite3.c
>>
>>Then link it into your program.  Most of us recommend avoiding shared
>>libraries.
>>
>>If you need special features you may have to set some flags.
>>
>>
>>-Original Message-
>>From: sqlite-users-boun...@sqlite.org
>>[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of David Clark
>>Sent: Wednesday, January 30, 2013 9:06 AM
>>To: sqlite-users@sqlite.org
>>Subject: [sqlite] Sqlite ubuntu 12.10 compile/install
>>
>>Ok I have used sqlite in windows software no problems.
>>I am now trying to use it in software I am porting to ubuntu 12.10 and I am
>>finding that the source code I used under windows has compile issues.  And
>>when I downloaded the .gz file and ran ./configure on that fileset I got
>>errors
>>on that.
>>
>>I know I not being specific on the errors I got.  But my question here is...
>>basically under ubuntu what should my procedure be for installing and
>>compiling sqlite?  Yes I am new to ubuntu so the obvious is not so obvious
>>on that OS.
>>
>>Thank you,
>>
>>David Clark
>>___
>>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



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


Re: [sqlite] Lock Database temporarily.

2013-01-09 Thread Christopher Vance
It sounds to me like your question has nothing to do with SQLite and
everything to do with the operating system your app is (not) running
on.

What facilities does your OS have to stop anything or anybody writing
a file? How do you propose to relax these facilities to enable your
app to write the file? How do you propose to do this without enabling
anything or anybody else writing the file while your app *is* running.

-- Christopher

On 9 January 2013 15:31, sants87 <santy.scor...@gmail.com> wrote:
> Simon,
>
> To answer your question, I want to stop modification when my app is not
> running/alive.
>
>
>
> --
> View this message in context: 
> http://sqlite.1065341.n5.nabble.com/Lock-Database-temporarily-tp66434p66454.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



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


Re: [sqlite] A bug concerning SQLite - no suport for Extended ASCII (filepath)

2012-11-24 Thread Christopher Vance
There is no such thing as extended ASCII. Presumably you mean one or
other part of ISO-8859. (I can't even remember which part was designed
for Polish.)

If you want to use non-ASCII characters in file names with any
program, not just SQLite, you need to have a method to specify what
character set the file name is in, and the program has to have a
mechanism to use that information. In some cases the specification can
be implicit.

Whether this is even possible depends on your operating system among
other things.

Because determining the character set used in naming files can be
problematic, many programs are written to reject anything other than a
small expected set of characters.

On 24 November 2012 03:35, Michal Walczak
<michal.walc...@studentpartner.com> wrote:
> I am using SQLite Release 3.7.14.1 downloaded by Nuget with Visual Studio 
> 2012 Ultimate RTM on Windows 8 Pro.
>
> Because I am Polish, I am using the extended ASCII charset, also my username 
> uses it. Apparently SQLite is not able to process the file name with the file 
> path which includes this characters.
>
>
> Error:
> "“Could not open database file: 
> C:\Users\Michał\AppData\Local\Packages\e12bc76c-4f76-4198-8ed7-a6b0d8828dd3_e7ma2tg35b58y\LocalState\people.db
>  (14)”"
>
>
> Temporary fix:
> I have created a local account without Extended ASCII and the project with 
> the database works.
>
> Best Regards,
> Michał Walczak
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] How much disk space is required to checkpoint?

2012-09-27 Thread Christopher Vance
On 28 September 2012 03:08, David Barrett <dbarr...@expensify.com> wrote:
> Also, I disagree its a "standard, time tested" solution.  I've never even
> heard of this trick before, and despite its passionate defense, I'd
> encourage everybody (including the SQLite maintainers) to stop using it.

I heard of it decades ago, at which point it became obvious, so you
must be a young'un. A common justification is that it means the file
disappears when the program terminates, so you don't have to catch all
exit and signal paths to delete the file. And the file is gone even if
your program receives an uncatchable signal.

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


Re: [sqlite] Problem compiling the c source produced by lemon

2012-02-27 Thread Christopher Vance
On 26 February 2012 04:17, Everard Mark Padama <thetrans...@gmail.com> wrote:
> I compiled lemon with no problem and input the grammar file as stated in
> http://souptonuts.sourceforge.net/readme_lemon_tutorial.html. But when i
> compile the
> c source file produced by lemon i am encountering errors; syntax error :
> ':' from cstdio. What is the solution for this. Thanks.

Have you tried using a C compiler?  sounds like you're using C++, not C.

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


[sqlite] C++ struct declarations

2010-07-19 Thread Christopher Vance
I've just started playing with SQLite on MacOS, Linux and OpenBSD,
with the intent of compiling on Windows too.

Using C, I think I'm getting the hang of it. Things compile fine, and
seem to work.

I've just tried using sqlite3.h (from the 3.6.23.1 amalgamation) with
C++ and find that it contains stuff which won't compile on C++ (I'm
currently using Apple's g++ 4.0.1).

My understanding is that declarations like

   typedef struct sqlite3 sqlite3;

are improper in C++, because the struct declaration already makes
sqlite3 a typedef. The error message says

  error: forward declaration of ‘struct sqlite3’

Unfortunately, there are a bunch of these. Perhaps making the typedef
name different from the struct tag is sufficient to resolve the
problem, although I'm guessing the compiler thinks it needs to know
not only that sqlite3 is a name for a type, but also what the contents
of the struct are.

Is there a working (with C++) sqlite3.h equivalent available
somewhere, or do I need to hack on it?

Of course, I may have missed something obvious...

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