SQLite

Anything QL Software or Programming Related.
Derek_Stewart
Font of All Knowledge
Posts: 3973
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: SQLite

Post by Derek_Stewart »

I know I keep on with this this... but could DBAS not do the same job as SQLite.

If some Procedures and Functions to give the same names as the commands in SQLite, are written in S*BASIC, compiled as Externals in Qliberator, or added to a CLI, is this not the same,

OK the data format maybe different.


Regards,

Derek
User avatar
Sparrowhawk
Super Gold Card
Posts: 649
Joined: Wed Dec 15, 2010 12:33 pm
Location: @131072
Contact:

Re: SQLite

Post by Sparrowhawk »

I think it would be a very big piece of work to convert SQL's declarative style into dbas' imperative one. Especially when dealing with joins, grouping and sub queries. Not impossible, and there are examples of this on other platforms, but certainly a non trivial exercise to cover all the bases (pun fully intended) .

Also, it's not just the language but the schema goodness such as indexes, constraints, sequences, foreign key relationships and cascades etc which make SQL so easy to use with structured data.

Anyway, I don't expect anyone to do this just because I've resurrected an old thread. It was more an enquiry as to whether it would be possible at all really.


a.k.a. Jean-Yves
Derek_Stewart
Font of All Knowledge
Posts: 3973
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: SQLite

Post by Derek_Stewart »

Hi,

I have compiled all the SQLite C module files to object files, except 3 files to make some changes to C68.

A problem one of the header files seem to be the use of: "LONG LONG" which implies 64 bit numbers, changing this to "long" allows the majority of files to compile to object files, is this okay, or should "LONG DOUBLE", be used in C68?

So, just got write the makefile...


Regards,

Derek
User avatar
NormanDunbar
Forum Moderator
Posts: 2277
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: SQLite

Post by NormanDunbar »

Long long is 64 bit integer but long double is 64 bit float so the data type don't match and stuff won't work. Probably.

I've not used C68 for a while, and I'm not at my laptop, does it have the 'stdint.h' header file with int64_t? If so, you could probably change long long to be int64_t perhaps?

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
XorA
Site Admin
Posts: 1368
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: SQLite

Post by XorA »

NormanDunbar wrote:Long long is 64 bit integer but long double is 64 bit float so the data type don't match and stuff won't work. Probably.

I've not used C68 for a while, and I'm not at my laptop, does it have the 'stdint.h' header file with int64_t? If so, you could probably change long long to be int64_t perhaps?
I think looking at the source 64bit types are not functional in C68, but there is some obvious signs they were due in the next (never released) version.


Derek_Stewart
Font of All Knowledge
Posts: 3973
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: SQLite

Post by Derek_Stewart »

Hi,

SQLite3 supports 64 bit integers:

The sqlite3_int64 and sqlite_int64 types can store integer values between -9223372036854775808 and +9223372036854775807 inclusive. The sqlite3_uint64 and sqlite_uint64 types can store integer values between 0 and +18446744073709551615 inclusive.

I am looking to see if SQLite3 can be compiled with 32 bit integers only.


Regards,

Derek
User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: SQLite

Post by mk79 »

NormanDunbar wrote:Long long is 64 bit integer but long double is 64 bit float so the data type don't match and stuff won't work. Probably.
Double is already 64-bit float, "long double" is implementation specific and is at least 64-bit but usually longer (can be 96 bit in C68's case). But long double support is incomplete anyway.
I've not used C68 for a while, and I'm not at my laptop, does it have the 'stdint.h' header file with int64_t? If so, you could probably change long long to be int64_t perhaps?
Unlike long double there is no 64-bit support whatsoever as far as I can tell.


User avatar
Peter
Font of All Knowledge
Posts: 2004
Joined: Sat Jan 22, 2011 8:47 am

Re: SQLite

Post by Peter »

As far as I remember, 64 bit integer support works with qdos-gcc, just not the C library support of course.


Derek_Stewart
Font of All Knowledge
Posts: 3973
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: SQLite

Post by Derek_Stewart »

Hi,

If I use QDOS-GCC to conpile the SQLite code with 64 bit integer support, how will the resultant executable work on a QL?

Or does it not matter...


Regards,

Derek
Derek_Stewart
Font of All Knowledge
Posts: 3973
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: SQLite

Post by Derek_Stewart »

Hi,

I tried to compile sqlite-amalgamation 3380000 with qdos-gcc in the docker implementation of qdos-gcc, which gave 2 error messages saying some libraries are missing:

sys/resources.h
sys/mman.h

since the sqlite amalgation compiles in the modern GCC, I assume the the above libraries are missing from GCC 2.93 and added the GCC later on in its life span.

Can the above libraries be added to qdos-gcc ?


Regards,

Derek
Post Reply