Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread ingo

On 27-1-2020 23:18, Richard Hipp wrote:
> For many years I have described SQLite as being "serverless", as a way
> to distinguish it from the more traditional client/server design of
> RDBMSes.  "Serverless" seemed like the natural term to use, as it
> seems to mean "without a server".
> 

client-serverless?

although I've always thought of it as an in-proces DB-library.

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


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Eric Grange
Maybe "edge" database ? Or "local" database ? Both are trending terms, on
the theme of taking control and performance back from the cloud.

"Embedded" would be technically good, but is often associated with devices
and small things these days.


Le mar. 28 janv. 2020 à 05:58, Rowan Worth  a écrit :

> On Tue, 28 Jan 2020 at 06:19, Richard Hipp  wrote:
>
> > Note that "in-process" and "embedded" are not adequate substitutes for
> > "serverless".  An RDBMS might be in-process or embedded but still be
> > running a server in a separate thread. In fact, that is how most
> > embedded RDBMSes other than SQLite work, if I am not much mistaken.
> >
>
> I think embedded does capture SQLite well though. For a lot of devs the
> target API is the important thing, and whether there are threads behind the
> scenes is something of an implementation detail. But it is certainly a nice
> feature of SQLite's implementation, perhaps "embedded, threadless" would
> work to clarify that (although it's not an objectively true description
> once WORKER_THREADS enter the equation).
>
> "in-thread" also has a certain appeal - it's not a term I've seen used
> before but it makes sense as a stronger version of "in-process."
>
> I can't find any general terms for a library which spawns threads vs. one
> which doesn't.
> -Rowan
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Rowan Worth
On Tue, 28 Jan 2020 at 06:19, Richard Hipp  wrote:

> Note that "in-process" and "embedded" are not adequate substitutes for
> "serverless".  An RDBMS might be in-process or embedded but still be
> running a server in a separate thread. In fact, that is how most
> embedded RDBMSes other than SQLite work, if I am not much mistaken.
>

I think embedded does capture SQLite well though. For a lot of devs the
target API is the important thing, and whether there are threads behind the
scenes is something of an implementation detail. But it is certainly a nice
feature of SQLite's implementation, perhaps "embedded, threadless" would
work to clarify that (although it's not an objectively true description
once WORKER_THREADS enter the equation).

"in-thread" also has a certain appeal - it's not a term I've seen used
before but it makes sense as a stronger version of "in-process."

I can't find any general terms for a library which spawns threads vs. one
which doesn't.
-Rowan
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Karl Billeter
On Mon, Jan 27, 2020 at 05:18:45PM -0500, Richard Hipp wrote:

> For many years I have described SQLite as being "serverless", as a way
> to distinguish it from the more traditional client/server design of
> RDBMSes.  "Serverless" seemed like the natural term to use, as it
...
> So what do I call this, if I can no longer use the word "serverless"
> without confusing people?
> 
> "no-server"?
> "sans-server"?
> "stackless"?
> "non-client/server"?

I feel "non-client/server" gets to the core of it, but is slightly negative in
context - "well, here's what I'm not..".  Also a little unwieldy.


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


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread David Baird
Edit, that last part should say "skim server" :D

On Mon, Jan 27, 2020, 10:54 PM David Baird  wrote:

> How about "skim server"? So if, "server" means a whole server, then like
> whole milk versus skim milk, a fraction of a server becomes severless :)
>
> On Mon, Jan 27, 2020, 9:57 PM Stephen Chrzanowski 
> wrote:
>
>> I'd stick with "serverless".  The marketing teams that make "serverless"
>> mean that websites don't run with "servers" are I-D-TEN-Ts.  It's a fad
>> phrase that'll go away eventually.  I understand marketing, and its
>> purpose, but, in this case, they're pushing it.
>>
>>
>> On Mon, Jan 27, 2020 at 9:31 PM sub sk79  wrote:
>>
>> > Also maybe Slipstreamed?
>> >
>> > -Neal
>> >
>> > On Monday, January 27, 2020, sub sk79  wrote:
>> >
>> > > How about Seamless, Integrated or Baked-in?
>> > >
>> > > -Neal
>> > >
>> > > On Monday, January 27, 2020, Warren Young  wrote:
>> > >
>> > >> On Jan 27, 2020, at 3:18 PM, Richard Hipp  wrote:
>> > >> >
>> > >> > "serverless" has become a popular buzz-word that
>> > >> > means "managed by my hosting provider rather than by me.”
>> > >>
>> > >> “Serverless” it a screwy buzzword anyway, because of course there’s
>> > still
>> > >> a server under its new meaning.
>> > >>
>> > >> My vote?  Keep using the term.  We were here first.
>> > >>
>> > >> This is an ancient problem.  It is why is any serious dictionary the
>> > >> count of definitions considerably exceeds the count of headwords.
>> These
>> > >> new kids?  “serverless, sense 2.”
>> > >> ___
>> > >> sqlite-users mailing list
>> > >> sqlite-users@mailinglists.sqlite.org
>> > >> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>> > >>
>> > >
>> > ___
>> > sqlite-users mailing list
>> > sqlite-users@mailinglists.sqlite.org
>> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>> >
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread David Baird
How about "skim server"? So if, "server" means a whole server, then like
whole milk versus skim milk, a fraction of a server becomes severless :)

On Mon, Jan 27, 2020, 9:57 PM Stephen Chrzanowski 
wrote:

> I'd stick with "serverless".  The marketing teams that make "serverless"
> mean that websites don't run with "servers" are I-D-TEN-Ts.  It's a fad
> phrase that'll go away eventually.  I understand marketing, and its
> purpose, but, in this case, they're pushing it.
>
>
> On Mon, Jan 27, 2020 at 9:31 PM sub sk79  wrote:
>
> > Also maybe Slipstreamed?
> >
> > -Neal
> >
> > On Monday, January 27, 2020, sub sk79  wrote:
> >
> > > How about Seamless, Integrated or Baked-in?
> > >
> > > -Neal
> > >
> > > On Monday, January 27, 2020, Warren Young  wrote:
> > >
> > >> On Jan 27, 2020, at 3:18 PM, Richard Hipp  wrote:
> > >> >
> > >> > "serverless" has become a popular buzz-word that
> > >> > means "managed by my hosting provider rather than by me.”
> > >>
> > >> “Serverless” it a screwy buzzword anyway, because of course there’s
> > still
> > >> a server under its new meaning.
> > >>
> > >> My vote?  Keep using the term.  We were here first.
> > >>
> > >> This is an ancient problem.  It is why is any serious dictionary the
> > >> count of definitions considerably exceeds the count of headwords.
> These
> > >> new kids?  “serverless, sense 2.”
> > >> ___
> > >> sqlite-users mailing list
> > >> sqlite-users@mailinglists.sqlite.org
> > >> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> > >>
> > >
> > ___
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Stephen Chrzanowski
I'd stick with "serverless".  The marketing teams that make "serverless"
mean that websites don't run with "servers" are I-D-TEN-Ts.  It's a fad
phrase that'll go away eventually.  I understand marketing, and its
purpose, but, in this case, they're pushing it.


On Mon, Jan 27, 2020 at 9:31 PM sub sk79  wrote:

> Also maybe Slipstreamed?
>
> -Neal
>
> On Monday, January 27, 2020, sub sk79  wrote:
>
> > How about Seamless, Integrated or Baked-in?
> >
> > -Neal
> >
> > On Monday, January 27, 2020, Warren Young  wrote:
> >
> >> On Jan 27, 2020, at 3:18 PM, Richard Hipp  wrote:
> >> >
> >> > "serverless" has become a popular buzz-word that
> >> > means "managed by my hosting provider rather than by me.”
> >>
> >> “Serverless” it a screwy buzzword anyway, because of course there’s
> still
> >> a server under its new meaning.
> >>
> >> My vote?  Keep using the term.  We were here first.
> >>
> >> This is an ancient problem.  It is why is any serious dictionary the
> >> count of definitions considerably exceeds the count of headwords.  These
> >> new kids?  “serverless, sense 2.”
> >> ___
> >> sqlite-users mailing list
> >> sqlite-users@mailinglists.sqlite.org
> >> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >>
> >
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread sub sk79
Also maybe Slipstreamed?

-Neal

On Monday, January 27, 2020, sub sk79  wrote:

> How about Seamless, Integrated or Baked-in?
>
> -Neal
>
> On Monday, January 27, 2020, Warren Young  wrote:
>
>> On Jan 27, 2020, at 3:18 PM, Richard Hipp  wrote:
>> >
>> > "serverless" has become a popular buzz-word that
>> > means "managed by my hosting provider rather than by me.”
>>
>> “Serverless” it a screwy buzzword anyway, because of course there’s still
>> a server under its new meaning.
>>
>> My vote?  Keep using the term.  We were here first.
>>
>> This is an ancient problem.  It is why is any serious dictionary the
>> count of definitions considerably exceeds the count of headwords.  These
>> new kids?  “serverless, sense 2.”
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread J Decker
Standalone (library / database provider )
native

header-only (almost)

there's an entry on 'standalone programs' in wikipedia, and there's lots of
other libraries that have standalone versions, but it's not a very well
defined word.

in-process is probably closest  (in-process database (interface/provider))

does it need to be a single word? or maybe just a catchy acronym, SIS
(standalone in-process service)  [probably not that one]

On Mon, Jan 27, 2020 at 4:03 PM Peter da Silva  wrote:

> Server-free sounds good. Standalone too. Integrated maybe?
>
> On Mon, Jan 27, 2020, 17:54 Donald Shepherd 
> wrote:
>
> > On Tue, 28 Jan 2020 at 10:19 am, Richard Hipp  wrote:
> >
> > > daemon-less?
> > > --
> > > D. Richard Hipp
> > > d...@sqlite.org
> >
> >
> > In-process? Same concept but defining it by what it is rather than what
> it
> > isn't.
> >
> > Regards,
> > Donald Shepherd.
> >
> > > 
> > ___
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread sky5walk
SQLite is your everywhere database, except on servers ;)

On Mon, Jan 27, 2020 at 9:12 PM sub sk79  wrote:

> How about Seamless, Integrated or Baked-in?
>
> -Neal
>
> On Monday, January 27, 2020, Warren Young  wrote:
>
> > On Jan 27, 2020, at 3:18 PM, Richard Hipp  wrote:
> > >
> > > "serverless" has become a popular buzz-word that
> > > means "managed by my hosting provider rather than by me.”
> >
> > “Serverless” it a screwy buzzword anyway, because of course there’s still
> > a server under its new meaning.
> >
> > My vote?  Keep using the term.  We were here first.
> >
> > This is an ancient problem.  It is why is any serious dictionary the
> count
> > of definitions considerably exceeds the count of headwords.  These new
> > kids?  “serverless, sense 2.”
> > ___
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread sub sk79
How about Seamless, Integrated or Baked-in?

-Neal

On Monday, January 27, 2020, Warren Young  wrote:

> On Jan 27, 2020, at 3:18 PM, Richard Hipp  wrote:
> >
> > "serverless" has become a popular buzz-word that
> > means "managed by my hosting provider rather than by me.”
>
> “Serverless” it a screwy buzzword anyway, because of course there’s still
> a server under its new meaning.
>
> My vote?  Keep using the term.  We were here first.
>
> This is an ancient problem.  It is why is any serious dictionary the count
> of definitions considerably exceeds the count of headwords.  These new
> kids?  “serverless, sense 2.”
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Jens Alfke


> On Jan 27, 2020, at 2:18 PM, Richard Hipp  wrote:
> 
> But more recently, "serverless" has become a popular buzz-word that
> means "managed by my hosting provider rather than by me."  

I hate this buzzword. It's especially confusing because peer-to-peer 
architectures are also validly described as serverless.

> How can I fix this?  What alternative word can I use in place of
> "serverless" to mean "without a server"?

Don't change it. The term is totally accurate for describing SQLite, and the 
other terms people are suggesting are IMHO less clear.

Rather, I would add a blurb to the "SQLite Is Serverless" web page, clarifying 
that you are using the original common-sensical definition of the word, not the 
current buzzword.

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


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Warren Young
On Jan 27, 2020, at 3:18 PM, Richard Hipp  wrote:
> 
> "serverless" has become a popular buzz-word that
> means "managed by my hosting provider rather than by me.”

“Serverless” it a screwy buzzword anyway, because of course there’s still a 
server under its new meaning.

My vote?  Keep using the term.  We were here first.

This is an ancient problem.  It is why is any serious dictionary the count of 
definitions considerably exceeds the count of headwords.  These new kids?  
“serverless, sense 2.”
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread jasql
I'll throw in "embedded", but I'd vote for "self contained" too :-)

> On 27. Jan 2020, at 23:57, Jay Kreibich  wrote:
> 
> I often describe it as “self contained.”
> 
>  -j
> 
> Sent from my iPhone
> 
>> On Jan 27, 2020, at 4:19 PM, Richard Hipp  wrote:
>> 
>> For many years I have described SQLite as being "serverless", as a way
>> to distinguish it from the more traditional client/server design of
>> RDBMSes.  "Serverless" seemed like the natural term to use, as it
>> seems to mean "without a server".
>> 
>> But more recently, "serverless" has become a popular buzz-word that
>> means "managed by my hosting provider rather than by me."  Many
>> readers have internalized this new marketing-driven meaning for
>> "serverless" and are hence confused when they see my claim that
>> "SQLite is serverless".
>> 
>> How can I fix this?  What alternative word can I use in place of
>> "serverless" to mean "without a server"?
>> 
>> Note that "in-process" and "embedded" are not adequate substitutes for
>> "serverless".  An RDBMS might be in-process or embedded but still be
>> running a server in a separate thread. In fact, that is how most
>> embedded RDBMSes other than SQLite work, if I am not much mistaken.
>> 
>> When I say "serverless" I mean that the application invokes a
>> function, that function performs some task on behalf of the
>> application, then the function returns, *and that is all*.  No threads
>> are left over, running in the background to do housekeeping.  The
>> function does send messages to some other thread or process.  The
>> function does not have an event loop.  The function does not have its
>> own stack. The function (with its subfunctions) does all the work
>> itself, using the callers stack, then returns control to the caller.
>> 
>> So what do I call this, if I can no longer use the word "serverless"
>> without confusing people?
>> 
>> "no-server"?
>> "sans-server"?
>> "stackless"?
>> "non-client/server"?
>> 
>> 
>> -- 
>> D. Richard Hipp
>> d...@sqlite.org
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Deon Brewis
In C/C++ the closest concept is a Header Only Library.

Except that SQLITE is not only C+++, and it's not header only...

Library Only Implementation?
In-Proc / In-Thread Library?
Self Contained Library?

Looks like I'm on a generally "Library" theme here...

- Deon

-Original Message-
From: sqlite-users  On Behalf Of 
Richard Hipp
Sent: Monday, January 27, 2020 2:19 PM
To: General Discussion of SQLite Database 
Subject: [sqlite] New word to replace "serverless"

For many years I have described SQLite as being "serverless", as a way to 
distinguish it from the more traditional client/server design of RDBMSes.  
"Serverless" seemed like the natural term to use, as it seems to mean "without 
a server".

But more recently, "serverless" has become a popular buzz-word that means 
"managed by my hosting provider rather than by me."  Many readers have 
internalized this new marketing-driven meaning for "serverless" and are hence 
confused when they see my claim that "SQLite is serverless".

How can I fix this?  What alternative word can I use in place of "serverless" 
to mean "without a server"?

Note that "in-process" and "embedded" are not adequate substitutes for 
"serverless".  An RDBMS might be in-process or embedded but still be running a 
server in a separate thread. In fact, that is how most embedded RDBMSes other 
than SQLite work, if I am not much mistaken.

When I say "serverless" I mean that the application invokes a function, that 
function performs some task on behalf of the application, then the function 
returns, *and that is all*.  No threads are left over, running in the 
background to do housekeeping.  The function does send messages to some other 
thread or process.  The function does not have an event loop.  The function 
does not have its own stack. The function (with its subfunctions) does all the 
work itself, using the callers stack, then returns control to the caller.

So what do I call this, if I can no longer use the word "serverless"
without confusing people?

"no-server"?
"sans-server"?
"stackless"?
"non-client/server"?


--
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread John McMahon

"When I use a word,' Humpty Dumpty said in rather a scornful
tone, 'it means just what I choose it to mean - neither more nor
less.'

'The question is,' said Alice, 'whether you can make words mean
so many different things.'

'The question is,' said Humpty Dumpty, 'which is to be master -
that's all."

- Lewis Carroll, Through the Looking Glass


On 28/01/2020 09:18, Richard Hipp wrote:

For many years I have described SQLite as being "serverless", as a way
to distinguish it from the more traditional client/server design of
RDBMSes.  "Serverless" seemed like the natural term to use, as it
seems to mean "without a server".

But more recently, "serverless" has become a popular buzz-word that
means "managed by my hosting provider rather than by me."  Many
readers have internalized this new marketing-driven meaning for
"serverless" and are hence confused when they see my claim that
"SQLite is serverless".

How can I fix this?  What alternative word can I use in place of
"serverless" to mean "without a server"?

Note that "in-process" and "embedded" are not adequate substitutes for
"serverless".  An RDBMS might be in-process or embedded but still be
running a server in a separate thread. In fact, that is how most
embedded RDBMSes other than SQLite work, if I am not much mistaken.

When I say "serverless" I mean that the application invokes a
function, that function performs some task on behalf of the
application, then the function returns, *and that is all*.  No threads
are left over, running in the background to do housekeeping.  The
function does send messages to some other thread or process.  The
function does not have an event loop.  The function does not have its
own stack. The function (with its subfunctions) does all the work
itself, using the callers stack, then returns control to the caller.

So what do I call this, if I can no longer use the word "serverless"
without confusing people?

"no-server"?
"sans-server"?
"stackless"?
"non-client/server"?




--
Regards
   John McMahon
  li...@jspect.fastmail.fm

When people say "The climate has changed before,"
these are the kinds of changes they're talking about.
https://xkcd.com/1732/

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


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Simon Slavin
On 27 Jan 2020, at 11:53pm, Donald Shepherd  wrote:

> In-process? Same concept but defining it by what it is rather than what it 
> isn't.

This comes closest to what I think needs stating.  What you're trying to say is 
that there's no process (on the accessing computer or some other computer 
across a network) which handles and coordinates all the database access.

I was thinking about the word 'decentralised' but that seems to mean something 
that used to be central.  'uncentralised' is a word which just needs 
explaining.  And 'uncoordinated' doesn't mean the right thing in English.

One problem is that 'server' has too many meanings now.  SQLite is certainly 
'serverless', but that doesn't say enough.  Does 'decentralised' mean anything 
useful to the sort of person who might need to read that description ?
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Peter da Silva
Server-free sounds good. Standalone too. Integrated maybe?

On Mon, Jan 27, 2020, 17:54 Donald Shepherd 
wrote:

> On Tue, 28 Jan 2020 at 10:19 am, Richard Hipp  wrote:
>
> > daemon-less?
> > --
> > D. Richard Hipp
> > d...@sqlite.org
>
>
> In-process? Same concept but defining it by what it is rather than what it
> isn't.
>
> Regards,
> Donald Shepherd.
>
> > 
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Donald Shepherd
On Tue, 28 Jan 2020 at 10:19 am, Richard Hipp  wrote:

> daemon-less?
> --
> D. Richard Hipp
> d...@sqlite.org


In-process? Same concept but defining it by what it is rather than what it
isn't.

Regards,
Donald Shepherd.

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


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Jen Pollock
"Server-free"? It's reasonably close to serverless, but doesn't have the
conflicting meaning.

Jen

On Mon, Jan 27, 2020 at 05:18:45PM -0500, Richard Hipp wrote:
> For many years I have described SQLite as being "serverless", as a way
> to distinguish it from the more traditional client/server design of
> RDBMSes.  "Serverless" seemed like the natural term to use, as it
> seems to mean "without a server".
> 
> But more recently, "serverless" has become a popular buzz-word that
> means "managed by my hosting provider rather than by me."  Many
> readers have internalized this new marketing-driven meaning for
> "serverless" and are hence confused when they see my claim that
> "SQLite is serverless".
> 
> How can I fix this?  What alternative word can I use in place of
> "serverless" to mean "without a server"?
> 
> Note that "in-process" and "embedded" are not adequate substitutes for
> "serverless".  An RDBMS might be in-process or embedded but still be
> running a server in a separate thread. In fact, that is how most
> embedded RDBMSes other than SQLite work, if I am not much mistaken.
> 
> When I say "serverless" I mean that the application invokes a
> function, that function performs some task on behalf of the
> application, then the function returns, *and that is all*.  No threads
> are left over, running in the background to do housekeeping.  The
> function does send messages to some other thread or process.  The
> function does not have an event loop.  The function does not have its
> own stack. The function (with its subfunctions) does all the work
> itself, using the callers stack, then returns control to the caller.
> 
> So what do I call this, if I can no longer use the word "serverless"
> without confusing people?
> 
> "no-server"?
> "sans-server"?
> "stackless"?
> "non-client/server"?
> 
> 
> -- 
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Richard Hipp
daemon-less?
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread John McMahon
Define what "serverless" means to you in the SQLite context and provide 
a link or pop-up to that definition wherever "serverless" occurs in the 
documentation. Perhaps also include what it doesn't mean if you think 
this is becoming an issue.


How others choose to define "serverless" should not be your problem.

Just my pennies worth,
John


On 28/01/2020 09:18, Richard Hipp wrote:

For many years I have described SQLite as being "serverless", as a way
to distinguish it from the more traditional client/server design of
RDBMSes.  "Serverless" seemed like the natural term to use, as it
seems to mean "without a server".

But more recently, "serverless" has become a popular buzz-word that
means "managed by my hosting provider rather than by me."  Many
readers have internalized this new marketing-driven meaning for
"serverless" and are hence confused when they see my claim that
"SQLite is serverless".

How can I fix this?  What alternative word can I use in place of
"serverless" to mean "without a server"?

Note that "in-process" and "embedded" are not adequate substitutes for
"serverless".  An RDBMS might be in-process or embedded but still be
running a server in a separate thread. In fact, that is how most
embedded RDBMSes other than SQLite work, if I am not much mistaken.

When I say "serverless" I mean that the application invokes a
function, that function performs some task on behalf of the
application, then the function returns, *and that is all*.  No threads
are left over, running in the background to do housekeeping.  The
function does send messages to some other thread or process.  The
function does not have an event loop.  The function does not have its
own stack. The function (with its subfunctions) does all the work
itself, using the callers stack, then returns control to the caller.

So what do I call this, if I can no longer use the word "serverless"
without confusing people?

"no-server"?
"sans-server"?
"stackless"?
"non-client/server"?




--
Regards
   John McMahon
  li...@jspect.fastmail.fm

When people say "The climate has changed before,"
these are the kinds of changes they're talking about.
https://xkcd.com/1732/

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


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread D Burgess
standalone seems reasonable.

To confuse things further, I have seen Sqlite embedded  in an embedded
web server,  serverless doesn't fit that case.

On Tue, Jan 28, 2020 at 9:45 AM Jose Isaias Cabrera  wrote:
>
>
> Richard Hipp, on Monday, January 27, 2020 05:18 PM, wrote...
> >
> > For many years I have described SQLite as being "serverless", as a way
> > to distinguish it from the more traditional client/server design of
> > RDBMSes.  "Serverless" seemed like the natural term to use, as it
> > seems to mean "without a server".
> >
> > But more recently, "serverless" has become a popular buzz-word that
> > means "managed by my hosting provider rather than by me."  Many
> > readers have internalized this new marketing-driven meaning for
> > "serverless" and are hence confused when they see my claim that
> > "SQLite is serverless".
>
> It's kinda funny.  Back in 2006 I needed to create an app with SQL but on a 
> local machine.  MySQL was too big for the simple app, so, I wanted something 
> without a server.  So, I actually searched on "serverless SQL engine", and 
> BOOOM!, sqlite.org came up.  Now you want to take that away from me. :-)
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Jay Kreibich
I often describe it as “self contained.”

  -j

Sent from my iPhone

> On Jan 27, 2020, at 4:19 PM, Richard Hipp  wrote:
> 
> For many years I have described SQLite as being "serverless", as a way
> to distinguish it from the more traditional client/server design of
> RDBMSes.  "Serverless" seemed like the natural term to use, as it
> seems to mean "without a server".
> 
> But more recently, "serverless" has become a popular buzz-word that
> means "managed by my hosting provider rather than by me."  Many
> readers have internalized this new marketing-driven meaning for
> "serverless" and are hence confused when they see my claim that
> "SQLite is serverless".
> 
> How can I fix this?  What alternative word can I use in place of
> "serverless" to mean "without a server"?
> 
> Note that "in-process" and "embedded" are not adequate substitutes for
> "serverless".  An RDBMS might be in-process or embedded but still be
> running a server in a separate thread. In fact, that is how most
> embedded RDBMSes other than SQLite work, if I am not much mistaken.
> 
> When I say "serverless" I mean that the application invokes a
> function, that function performs some task on behalf of the
> application, then the function returns, *and that is all*.  No threads
> are left over, running in the background to do housekeeping.  The
> function does send messages to some other thread or process.  The
> function does not have an event loop.  The function does not have its
> own stack. The function (with its subfunctions) does all the work
> itself, using the callers stack, then returns control to the caller.
> 
> So what do I call this, if I can no longer use the word "serverless"
> without confusing people?
> 
> "no-server"?
> "sans-server"?
> "stackless"?
> "non-client/server"?
> 
> 
> -- 
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Jose Isaias Cabrera

Richard Hipp, on Monday, January 27, 2020 05:18 PM, wrote...
>
> For many years I have described SQLite as being "serverless", as a way
> to distinguish it from the more traditional client/server design of
> RDBMSes.  "Serverless" seemed like the natural term to use, as it
> seems to mean "without a server".
>
> But more recently, "serverless" has become a popular buzz-word that
> means "managed by my hosting provider rather than by me."  Many
> readers have internalized this new marketing-driven meaning for
> "serverless" and are hence confused when they see my claim that
> "SQLite is serverless".

It's kinda funny.  Back in 2006 I needed to create an app with SQL but on a 
local machine.  MySQL was too big for the simple app, so, I wanted something 
without a server.  So, I actually searched on "serverless SQL engine", and 
BOOOM!, sqlite.org came up.  Now you want to take that away from me. :-)
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Gerry Snyder
I think of it as being "standalone."

Gerry Snyder

On Mon, Jan 27, 2020, 3:19 PM Richard Hipp  wrote:

> For many years I have described SQLite as being "serverless", as a way
> to distinguish it from the more traditional client/server design of
> RDBMSes.  "Serverless" seemed like the natural term to use, as it
> seems to mean "without a server".
>
> But more recently, "serverless" has become a popular buzz-word that
> means "managed by my hosting provider rather than by me."  Many
> readers have internalized this new marketing-driven meaning for
> "serverless" and are hence confused when they see my claim that
> "SQLite is serverless".
>
> How can I fix this?  What alternative word can I use in place of
> "serverless" to mean "without a server"?
>
> Note that "in-process" and "embedded" are not adequate substitutes for
> "serverless".  An RDBMS might be in-process or embedded but still be
> running a server in a separate thread. In fact, that is how most
> embedded RDBMSes other than SQLite work, if I am not much mistaken.
>
> When I say "serverless" I mean that the application invokes a
> function, that function performs some task on behalf of the
> application, then the function returns, *and that is all*.  No threads
> are left over, running in the background to do housekeeping.  The
> function does send messages to some other thread or process.  The
> function does not have an event loop.  The function does not have its
> own stack. The function (with its subfunctions) does all the work
> itself, using the callers stack, then returns control to the caller.
>
> So what do I call this, if I can no longer use the word "serverless"
> without confusing people?
>
> "no-server"?
> "sans-server"?
> "stackless"?
> "non-client/server"?
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Tim Streater
On 27 Jan 2020, at 22:18, Richard Hipp  wrote:

> For many years I have described SQLite as being "serverless", as a way
> to distinguish it from the more traditional client/server design of
> RDBMSes.  "Serverless" seemed like the natural term to use, as it
> seems to mean "without a server".
>
> But more recently, "serverless" has become a popular buzz-word that
> means "managed by my hosting provider rather than by me."  Many
> readers have internalized this new marketing-driven meaning for
> "serverless" and are hence confused when they see my claim that
> "SQLite is serverless".
>
> How can I fix this?  What alternative word can I use in place of
> "serverless" to mean "without a server"?

Fundamentally SQLite is a library that you link in, either at app build time or 
later at runtime. I'd prefer a term that suggests this.


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


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Esdras Mayrink
Runtimeless?
Not sure if the word runtimeless would be accurate to describe SQLite.
I'm not sure if it is even a word, I'm not a native english speaker.

But here is my contribution.

On Mon, Jan 27, 2020 at 7:19 PM Richard Hipp  wrote:

> For many years I have described SQLite as being "serverless", as a way
> to distinguish it from the more traditional client/server design of
> RDBMSes.  "Serverless" seemed like the natural term to use, as it
> seems to mean "without a server".
>
> But more recently, "serverless" has become a popular buzz-word that
> means "managed by my hosting provider rather than by me."  Many
> readers have internalized this new marketing-driven meaning for
> "serverless" and are hence confused when they see my claim that
> "SQLite is serverless".
>
> How can I fix this?  What alternative word can I use in place of
> "serverless" to mean "without a server"?
>
> Note that "in-process" and "embedded" are not adequate substitutes for
> "serverless".  An RDBMS might be in-process or embedded but still be
> running a server in a separate thread. In fact, that is how most
> embedded RDBMSes other than SQLite work, if I am not much mistaken.
>
> When I say "serverless" I mean that the application invokes a
> function, that function performs some task on behalf of the
> application, then the function returns, *and that is all*.  No threads
> are left over, running in the background to do housekeeping.  The
> function does send messages to some other thread or process.  The
> function does not have an event loop.  The function does not have its
> own stack. The function (with its subfunctions) does all the work
> itself, using the callers stack, then returns control to the caller.
>
> So what do I call this, if I can no longer use the word "serverless"
> without confusing people?
>
> "no-server"?
> "sans-server"?
> "stackless"?
> "non-client/server"?
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread sky5walk
Client (only) db
Sequential db

On Mon, Jan 27, 2020, 5:27 PM Peter da Silva  wrote:

> Local?
>
> On Mon, 27 Jan 2020, 16:19 Richard Hipp,  wrote:
>
> > For many years I have described SQLite as being "serverless", as a way
> > to distinguish it from the more traditional client/server design of
> > RDBMSes.  "Serverless" seemed like the natural term to use, as it
> > seems to mean "without a server".
> >
> > But more recently, "serverless" has become a popular buzz-word that
> > means "managed by my hosting provider rather than by me."  Many
> > readers have internalized this new marketing-driven meaning for
> > "serverless" and are hence confused when they see my claim that
> > "SQLite is serverless".
> >
> > How can I fix this?  What alternative word can I use in place of
> > "serverless" to mean "without a server"?
> >
> > Note that "in-process" and "embedded" are not adequate substitutes for
> > "serverless".  An RDBMS might be in-process or embedded but still be
> > running a server in a separate thread. In fact, that is how most
> > embedded RDBMSes other than SQLite work, if I am not much mistaken.
> >
> > When I say "serverless" I mean that the application invokes a
> > function, that function performs some task on behalf of the
> > application, then the function returns, *and that is all*.  No threads
> > are left over, running in the background to do housekeeping.  The
> > function does send messages to some other thread or process.  The
> > function does not have an event loop.  The function does not have its
> > own stack. The function (with its subfunctions) does all the work
> > itself, using the callers stack, then returns control to the caller.
> >
> > So what do I call this, if I can no longer use the word "serverless"
> > without confusing people?
> >
> > "no-server"?
> > "sans-server"?
> > "stackless"?
> > "non-client/server"?
> >
> >
> > --
> > D. Richard Hipp
> > d...@sqlite.org
> > ___
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Peter da Silva
Local?

On Mon, 27 Jan 2020, 16:19 Richard Hipp,  wrote:

> For many years I have described SQLite as being "serverless", as a way
> to distinguish it from the more traditional client/server design of
> RDBMSes.  "Serverless" seemed like the natural term to use, as it
> seems to mean "without a server".
>
> But more recently, "serverless" has become a popular buzz-word that
> means "managed by my hosting provider rather than by me."  Many
> readers have internalized this new marketing-driven meaning for
> "serverless" and are hence confused when they see my claim that
> "SQLite is serverless".
>
> How can I fix this?  What alternative word can I use in place of
> "serverless" to mean "without a server"?
>
> Note that "in-process" and "embedded" are not adequate substitutes for
> "serverless".  An RDBMS might be in-process or embedded but still be
> running a server in a separate thread. In fact, that is how most
> embedded RDBMSes other than SQLite work, if I am not much mistaken.
>
> When I say "serverless" I mean that the application invokes a
> function, that function performs some task on behalf of the
> application, then the function returns, *and that is all*.  No threads
> are left over, running in the background to do housekeeping.  The
> function does send messages to some other thread or process.  The
> function does not have an event loop.  The function does not have its
> own stack. The function (with its subfunctions) does all the work
> itself, using the callers stack, then returns control to the caller.
>
> So what do I call this, if I can no longer use the word "serverless"
> without confusing people?
>
> "no-server"?
> "sans-server"?
> "stackless"?
> "non-client/server"?
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] New word to replace "serverless"

2020-01-27 Thread Edward Lau
I like "NO-SERVER"


-Original Message-
From: Richard Hipp 
To: General Discussion of SQLite Database 
Sent: Mon, Jan 27, 2020 2:18 pm
Subject: [sqlite] New word to replace "serverless"

For many years I have described SQLite as being "serverless", as a way
to distinguish it from the more traditional client/server design of
RDBMSes.  "Serverless" seemed like the natural term to use, as it
seems to mean "without a server".

But more recently, "serverless" has become a popular buzz-word that
means "managed by my hosting provider rather than by me."  Many
readers have internalized this new marketing-driven meaning for
"serverless" and are hence confused when they see my claim that
"SQLite is serverless".

How can I fix this?  What alternative word can I use in place of
"serverless" to mean "without a server"?

Note that "in-process" and "embedded" are not adequate substitutes for
"serverless".  An RDBMS might be in-process or embedded but still be
running a server in a separate thread. In fact, that is how most
embedded RDBMSes other than SQLite work, if I am not much mistaken.

When I say "serverless" I mean that the application invokes a
function, that function performs some task on behalf of the
application, then the function returns, *and that is all*.  No threads
are left over, running in the background to do housekeeping.  The
function does send messages to some other thread or process.  The
function does not have an event loop.  The function does not have its
own stack. The function (with its subfunctions) does all the work
itself, using the callers stack, then returns control to the caller.

So what do I call this, if I can no longer use the word "serverless"
without confusing people?

"no-server"?
"sans-server"?
"stackless"?
"non-client/server"?


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] New word to replace "serverless"

2020-01-27 Thread Richard Hipp
For many years I have described SQLite as being "serverless", as a way
to distinguish it from the more traditional client/server design of
RDBMSes.  "Serverless" seemed like the natural term to use, as it
seems to mean "without a server".

But more recently, "serverless" has become a popular buzz-word that
means "managed by my hosting provider rather than by me."  Many
readers have internalized this new marketing-driven meaning for
"serverless" and are hence confused when they see my claim that
"SQLite is serverless".

How can I fix this?  What alternative word can I use in place of
"serverless" to mean "without a server"?

Note that "in-process" and "embedded" are not adequate substitutes for
"serverless".  An RDBMS might be in-process or embedded but still be
running a server in a separate thread. In fact, that is how most
embedded RDBMSes other than SQLite work, if I am not much mistaken.

When I say "serverless" I mean that the application invokes a
function, that function performs some task on behalf of the
application, then the function returns, *and that is all*.  No threads
are left over, running in the background to do housekeeping.  The
function does send messages to some other thread or process.  The
function does not have an event loop.  The function does not have its
own stack. The function (with its subfunctions) does all the work
itself, using the callers stack, then returns control to the caller.

So what do I call this, if I can no longer use the word "serverless"
without confusing people?

"no-server"?
"sans-server"?
"stackless"?
"non-client/server"?


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] importing data to a table that has generated-columns

2020-01-27 Thread Keith Medcalf

On Monday, 27 January, 2020 10:31, James K. Lowden  
wrote:

>On Sun, 26 Jan 2020 12:01:32 -0700
>"Keith Medcalf"  wrote:

>> Now that the table exists, use "SELECT * FROM " to determine
>> the number of columns in the table (which will include computed
>> always columns, if any).
>...
>> Otherwise, Richard *may* make some changes to the .import logic which
>> *might* appear in the next release version.

>I imagine it's already being considered: if pragma table_info included
>a column with the SQL for generated columns (and NULL) otherwise, the
>shell could use that instead of SELECT * to determine the number of
>insertable columns.

That data is already in the schema structures as is the assigned affinity:

SQLite version 3.31.0 2020-01-27 17:01:49
Enter ".help" for usage hints.
sqlite> .schema details
CREATE TABLE Details
(
ApplianceID integer not null references Appliances(ApplianceID) on 
delete cascade,
SrcIntIDinteger not null references Interfaces(InterfaceID) on 
delete cascade,
DstIntIDinteger not null references Interfaces(InterfaceID) on 
delete cascade,
Transport   text not null collate nocase,
SrcHostID   integer not null references Hosts(HostID) on delete cascade,
SrcPort integer not null,
DstHostID   integer not null references Hosts(HostID) on delete cascade,
DstPort integer not null,
Action  integer not null,
Count   integer not null,
FileID  integer not null references Files(FileID) on delete cascade
);
sqlite> .mode col
sqlite> .head on
sqlite> pragma table_xinfo(details);
cid nametypeaff collnotnull 
dflt_value  pk  rowid   autoinc hidden
--  --  --  --  --  --  
--  --  --  --  --
-1  INTEGER 0   
1   1   0   1
0   ApplianceI  integer INTEGER 1   
0   0   0   0
1   SrcIntIDinteger INTEGER 1   
0   0   0   0
2   DstIntIDinteger INTEGER 1   
0   0   0   0
3   Transport   textTEXTnocase  1   
0   0   0   0
4   SrcHostID   integer INTEGER 1   
0   0   0   0
5   SrcPort integer INTEGER 1   
0   0   0   0
6   DstHostID   integer INTEGER 1   
0   0   0   0
7   DstPort integer INTEGER 1   
0   0   0   0
8   Action  integer INTEGER 1   
0   0   0   0
9   Count   integer INTEGER 1   
0   0   0   0
10  FileID  integer INTEGER 1   
0   0   0   0
sqlite> create table x(id integer primary key, a datetime not null, c as (id + 
1), d as (id + 2) stored, e as (id + 3));
sqlite> pragma table_xinfo(x);
cid nametypeaff collnotnull 
dflt_value  pk  rowid   autoinc hidden
--  --  --  --  --  --  
--  --  --  --  --
0   id  integer INTEGER 0   
1   1   0   0
1   a   datetimeNUMERIC 1   
0   0   0   0
2   c   BLOB0   
0   0   0   2
3   d   BLOB0   
0   0   0   3
4   e   BLOB0   
0   0   0   2

This is my "modified" table_info pragma that returns somewhat more information 
for each column (all of which comes from the in the in-memory schema).  The 
"hidden" value is 0 for visible columns, 1 for "hidden" columns, 2 for computed 
virtual columns and 3 for computed stored columns.  I also added a 
database_info pragma that returns a list of objects in all attached schema's so 
that it is easier to define useful information views.

sqlite> create temporary table x(x);
sqlite> .width 8 8 64
sqlite> pragma database_info;
schematype  name
    

Re: [sqlite] importing data to a table that has generated-columns

2020-01-27 Thread James K. Lowden
On Sun, 26 Jan 2020 12:01:32 -0700
"Keith Medcalf"  wrote:

> Now that the table exists, use "SELECT * FROM " to determine
> the number of columns in the table (which will include computed
> always columns, if any).
...
> Otherwise, Richard *may* make some changes to the .import logic which
> *might* appear in the next release version.  

I imagine it's already being considered: if pragma table_info included
a column with the SQL for generated columns (and NULL) otherwise, the
shell could use that instead of SELECT * to determine the number of
insertable columns.  

I'm a little confused, though.  ISTR the shell does something clever
with .import, because constraints that enforce numeric types are
violated even when the data are numeric.  Is that simply because the
shell uses sqlite3_bind_text for every column, and the system doesn't
attempt to convert numeric text to a numeric type, regardless of the
column's declared type?  

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


Re: [sqlite] sqlite-3.31.0 segfaults on fuzzcheck on s390x architectures

2020-01-27 Thread Richard Hipp
On 1/27/20, Ondrej Dubaj  wrote:
> The problem appears to be only on this arches.

That probably means it is an EBCDIC problem.

We have no way of replicating or debugging this problem as we have no
access to an s390 machine.  Can RedHat perhaps provide one of the
SQLite developers with a temporary ssh account into an s390 machine so
that we can investigate and fix the problem?

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQL CASE WHEN THEN ELSE END

2020-01-27 Thread Jose Isaias Cabrera

David Raymond, on Monday, January 27, 2020 10:32 AM, wrote...

[clip]
> (c.WYear = 2020) is a perfectly valid expression... that's returning a
> boolean (well, int)
> So you're comparing c.WYear (from the subquery) against a boolean.

Yep, this little bit I knew. :-)

> (Others have replied with improved versions of the query, but for people
> following at home I figured I'd try to point out why the original version
> parsed ok and ran, just wasn't what you intended)

Fair enough...
The original email had inserts that would suffice the table that would create 
the 'YES' or the 'NO'. For example...

create table t0 (n INTEGER PRIMARY KEY, a, b, c, d, e, idate);
insert into t0 (a, b, c, d, e, idate) values ('p001', 1, 2019, 'n', 4, 
'2019-02-11');
insert into t0 (a, b, c, d, e, idate) values ('p002', 2, 2019, 'n', 4, 
'2019-02-11');
insert into t0 (a, b, c, d, e, idate) values ('p003', 3, 2019, 'n', 4, 
'2019-02-11');
insert into t0 (a, b, c, d, e, idate) values ('p004', 4, 2019, 'y', 4, 
'2019-02-11');
insert into t0 (a, b, c, d, e, idate) values ('p005', 5, 2019, 'y', 4, 
'2019-02-11');
insert into t0 (a, b, c, d, e, idate) values ('p001', 10, 2020, 'n', 4, 
'2019-02-12');
insert into t0 (a, b, c, d, e, idate) values ('p002', 2, 2019, 'n', 4, 
'2019-02-12');
insert into t0 (a, b, c, d, e, idate) values ('p003', 3, 2019, 'y', 4, 
'2019-02-12');
insert into t0 (a, b, c, d, e, idate) values ('p004', 4, 2019, 'y', 4, 
'2019-02-12');
insert into t0 (a, b, c, d, e, idate) values ('p005', 5, 2019, 'y', 4, 
'2019-02-12');
insert into t0 (a, b, c, d, e, idate) values ('p001', 10, 2020, 'n', 4, 
'2019-02-13');
insert into t0 (a, b, c, d, e, idate) values ('p002', 2, 2019, 'n', 4, 
'2019-02-13');
insert into t0 (a, b, c, d, e, idate) values ('p003', 3, 2020, 'y', 4, 
'2019-02-13');
insert into t0 (a, b, c, d, e, idate) values ('p004', 5, 2019, 'n', 4, 
'2019-02-13');
insert into t0 (a, b, c, d, e, idate) values ('p005', 5, 2020, 'y', 8, 
'2019-02-13');

create table t1 (n INTEGER PRIMARY KEY, f, g, h, i, j, idate);
insert into t1 (f, g, h, i, j, idate) values ('p001', 1, 4, 'n', 4, 
'2019-02-11');
insert into t1 (f, g, h, i, j, idate) values ('p002', 2, 3, 'n', 4, 
'2019-02-11');
insert into t1 (f, g, h, i, j, idate) values ('p003', 3, 2, 'n', 4, 
'2019-02-11');
insert into t1 (f, g, h, i, j,  idate) values ('p004', 4, 5, 'y', 4, 
'2019-02-11');
insert into t1 (f, g, h, i, j, idate) values ('p005', 5, 3, 'y', 4, 
'2019-02-11');
insert into t1 (f, g, h, i, j, idate) values ('p001', 10, 2, 'n', 4, 
'2019-02-12');
insert into t1 (f, g, h, i, j, idate) values ('p002', 2, 6, 'n', 4, 
'2019-02-12');
insert into t1 (f, g, h, i, j, idate) values ('p003', 3, 7, 'y', 4, 
'2019-02-12');
insert into t1 (f, g, h, i, j, idate) values ('p004', 4, 1, 'y', 4, 
'2019-02-12');
insert into t1 (f, g, h, i, j, idate) values ('p005', 5, 2, 'y', 4, 
'2019-02-12');
insert into t1 (f, g, h, i, j, idate) values ('p001', 10, 1, 'n', 4, 
'2019-02-13');
insert into t1 (f, g, h, i, j, idate) values ('p002', 2, 8, 'n', 4, 
'2019-02-13');
insert into t1 (f, g, h, i, j, idate) values ('p003', 3, 9, 'y', 4, 
'2019-02-13');
insert into t1 (f, g, h, i, j, idate) values ('p004', 5, 3, 'n', 4, 
'2019-02-13');
insert into t1 (f, g, h, i, j, idate) values ('p005', 5, 3, 'y', 8, 
'2019-02-13');

create table t2 (pid, WYear);
insert into t2 values ('p001', 2019);
insert into t2 values ('p003', 2019);
insert into t2 values ('p004', 2019);
insert into t2 values ('p002', 2020);
insert into t2 values ('p003', 2020);
insert into t2 values ('p005', 2020);

As you can see, t2 contains data matches well with t0 and t1 regarding a, f and 
pid.  However, when I ran this on the real data, I found out that that there 
was data missing, ie.

insert into t0 (a, b, c, d, e, idate) values ('p006', 5, 2020, 'y', 8, 
'2019-03-13');
insert into t0 (a, b, c, d, e, idate) values ('p007', 5, 2020, 'n', 8, 
'2019-03-13');
insert into t0 (a, b, c, d, e, idate) values ('p008', 5, 2020, 'n', 8, 
'2019-03-13');

and

insert into t1 (f, g, h, i, j, idate) values ('p006', 6, 7, 'n', 8, 
'2019-03-13');
insert into t1 (f, g, h, i, j, idate) values ('p007', 6, 7, 'n', 8, 
'2019-03-13');
insert into t1 (f, g, h, i, j, idate) values ('p008', 6, 9, 'y', 8, 
'2019-03-13');

So, when I ran the original query,

SELECT a.a,
 a.c,
 a.e,
 b.g,
 b.h,
 b.i,
 coalesce((
   SELECT 'YES'
 FROM t2
WHERE wYear == a.c
  AND pid == a.a
  ),  'NO') AS digital
FROM t0 as a, t1 as b
   WHERE a.a == b.f
 AND a.idate == (SELECT MAX(idate) from t0 where a = a.a)
 AND b.idate == (SELECT MAX(idate) from t1 where f = a.a)
 AND a.a IN (SELECT pid FROM t2)
 AND a.c == 2020
;

it would only give me the records that were part of t2:

p001|2020|4|10|1|n|NO
p003|2020|4|3|9|y|YES
p005|2020|8|5|3|y|YES

But, I also needed to display p006, p007, p008.  So, by taking 

Re: [sqlite] SQL CASE WHEN THEN ELSE END

2020-01-27 Thread David Raymond
This is technically valid CASE syntax which is why you're not getting an error, 
it's just not what you're looking for.
...
CASE
(SELECT c.WYear FROM t2 WHERE pid = a.a)
WHEN c.WYear = 2020 THEN “YES” ELSE “NO” END
) AS DIGITAL
...

What that is saying is take the value you get from this:

(SELECT c.WYear FROM t2 WHERE pid = a.a)

and compare it to the value you get from this:

(c.WYear = 2020)

and if those two values match, then return the value of the field that's named 
"YES" (I'm assuming you wanted 'YES' there)

(c.WYear = 2020) is a perfectly valid expression... that's returning a boolean 
(well, int)
So you're comparing c.WYear (from the subquery) against a boolean.


(Others have replied with improved versions of the query, but for people 
following at home I figured I'd try to point out why the original version 
parsed ok and ran, just wasn't what you intended)

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


Re: [sqlite] SQL CASE WHEN THEN ELSE END

2020-01-27 Thread Jose Isaias Cabrera

Jose Isaias Cabrera, on Monday, January 27, 2020 08:42 AM, wrote...
>
>
> Keith Medcalf, on Monday, January 27, 2020 04:02 AM, wrote...

This is actually what I need:

SELECT a.a,
 a.c,
 a.e,
 b.g,
 b.h,
 b.i,
 coalesce((
   SELECT 'YES'
 FROM t2
WHERE wYear == a.c
  AND pid == a.a
  ),  'NO') AS digital
FROM t0 as a, t1 as b
   WHERE a.a == b.f
 AND a.idate == (SELECT MAX(idate) from t0 where a = a.a)
 AND b.idate == (SELECT MAX(idate) from t1 where f = a.a)
 AND a.c == 2020
;

Because there are other records that are in the other databases, but not in t2, 
which still need to be part of the result.  Thanks for everything Igor, Keith, 
Simon, and everyone who thought about it. ;-)

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


Re: [sqlite] SQL CASE WHEN THEN ELSE END

2020-01-27 Thread Jose Isaias Cabrera

Keith Medcalf, on Monday, January 27, 2020 04:02 AM, wrote...
>
>
> This version generates the most efficient query plan in 3.31.0 when you
> have indexes on the necessary columns:
>
> CREATE INDEX t0_1 on t0 (a, idate, c); -- c does not have to be in the
> index
> CREATE INDEX t1_1 on t1 (f, idate);
> CREATE INDEX t2_1 on t2 (pid, wyear); -- this could be a without rowid
> table with both columns in the primary key

I think I already have these INDEXes, but I will make sure.  Thanks for this 
one also.  I love having different ways to write the code.

> with keys (pid, idate0, idate1)
>   as (
>   select distinct pid,
>  (
>   select max(idate)
> from t0
>where a == pid
>  ),
>  (
>   select max(idate)
> from t1
>where f == pid
>  )
> from (
>   select distinct pid
> from t2
>  )
>  )
>   SELECT a.a,
>  a.c,
>  a.e,
>  b.g,
>  b.h,
>  b.i,
>  coalesce((
>SELECT 'YES'
>  FROM t2
> WHERE wYear == a.c
>   AND pid == a.a
>   ),  'NO') AS digital
> FROM t0 as a, t1 as b, keys
>WHERE a.a == keys.pid
>  AND b.f == keys.pid
>  AND a.idate == keys.idate0
>  AND b.idate == keys.idate1
>  AND a.c == 2020
> ;
>
> without help the query planner does not seem to generate a very good plan
> but maybe that is because the sample data is so small ... or maybe it does
> and I cannot tell with such small data ... but this forces the query to
> execute in the manner I think it should. If you take the "distinct" from
> the keys select it frees up the query planner to perhaps find a better plan
> -- you need the "select distinct pid from t2" to prevent duplicate rows.

Thanks, Keith.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQL CASE WHEN THEN ELSE END

2020-01-27 Thread Jose Isaias Cabrera

Keith Medcalf, on Monday, January 27, 2020 02:28 AM, wrote...
>
>
> Do you perhaps mean:
>
>   SELECT a.a,
>  a.c,
>  a.e,
>  b.g,
>  b.h,
>  b.i,
>  coalesce((
>SELECT 'YES'
>  FROM t2
> WHERE wYear == a.c
>   AND pid == a.a
>   ),  'NO') AS digital
> FROM t0 as a, t1 as b
>WHERE a.a == b.f
>  AND a.idate == (SELECT MAX(idate) from t0 where a = a.a)
>  AND b.idate == (SELECT MAX(idate) from t1 where f = a.a)
>  AND a.a IN (SELECT pid FROM t2)
>  AND a.c == 2020
> ;
>

Yep, this one works also.  Thanks.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [EXTERNAL] Re: Row length in SQLITE

2020-01-27 Thread Keith Medcalf

Except that should be for the header bytes only.  It is somewhat inaccurate 
because IEEE doubles may be stored as varints and values 0 and 1 may be stored 
as just the header code 8 or 9 without storing the actual varint (if the schema 
version is 4 or more, which cannot be read in an extension, though I suppose 
the context points to the connection which points to the schema which somewhere 
along the way will have the schema version, though those pointers are supposed 
to be opaque).  Plus of course that size is the size of the header + the size 
of the varint storing the size of the header all as a varint ...

However, assuming schema type 4 then the following is more accurate.  Though if 
the column has no affinity then not all the optimizations are applied.

SQLITE_PRIVATE void _recSizeFunc(sqlite3_context *context, int argc, 
sqlite3_value **argv)
{
sqlite_int64 hdrsize = 0;
sqlite_int64 datsize = 0;
sqlite_int64 sz;
double v;
int i;

for (i=0; i 1))
datsize += _varIntSize_(sqlite3_value_int64(argv[i]));
break;
case SQLITE_FLOAT:
hdrsize += 1;
v = sqlite3_value_double(argv[i]);
if ((fabs(v) <= 140737488355327.0) && (trunc(v) == v))
{
if ((v < 0) || (v > 1))
datsize += _varIntSize_((sqlite_int64)v);
}
else
datsize += 8;
break;
case SQLITE_TEXT:
sqlite3_value_blob(argv[i]);
sz = sqlite3_value_bytes(argv[i]);
hdrsize += _varIntSize_(sz*2+12);
datsize += sz;
break;
case SQLITE_BLOB:
sz = sqlite3_value_bytes(argv[i]);
hdrsize += _varIntSize_(sz*2+13);
datsize += sz;
break;
}
}
sqlite3_result_int64(context, _varIntSize_(hdrsize +_varIntSize_(hdrsize)) 
+ hdrsize + datsize);
}


-- 
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.

>-Original Message-
>From: sqlite-users  On
>Behalf Of Hick Gunter
>Sent: Monday, 27 January, 2020 05:32
>To: SQLite mailing list 
>Subject: Re: [sqlite] [EXTERNAL] Re: Row length in SQLITE
>
>You are missing
>
>maxsize += _varIntSize_(maxsize)
>
>fort he size varint at the begin oft he header just before the return
>
>-Ursprüngliche Nachricht-
>Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org]
>Im Auftrag von Keith Medcalf
>Gesendet: Montag, 27. Januar 2020 12:43
>An: SQLite mailing list 
>Betreff: [EXTERNAL] Re: [sqlite] Row length in SQLITE
>
>
>Here is a wee bit of C code that you can compile as a plugin that will
>give you the row size (well, it may be bigger than the actual record size
>by a few bytes but it is pretty close) ...
>
>works properly for utf-16 encoded databases as well.
>
>-//- sqlsize.c -//-
>#include "sqlite3ext.h"
>SQLITE_EXTENSION_INIT1
>
>#ifndef SQLITE_PRIVATE
>#define SQLITE_PRIVATE static
>#endif
>
>static inline sqlite_int64 _varIntSize_(sqlite_int64 v) {
>sqlite_int64 uu;
>
>if (v<0)
>uu = ~v;
>else
>uu = v;
>if (uu <= 127 )
>return 1;
>else if (uu <= 32767)
>return 2;
>else if (uu <= 8388607)
>return 3;
>else if (uu <= 2147483647)
>return 4;
>else if (uu <= 140737488355327LL)
>return 6;
>else return 8;
>}
>
>SQLITE_PRIVATE void _recSizeFunc(sqlite3_context *context, int argc,
>sqlite3_value **argv) {
>sqlite_int64 maxsize = 0;
>sqlite_int64 sz;
>int i;
>
>for (i=0; i{
>switch (sqlite3_value_type(argv[i]))
>{
>case SQLITE_NULL:
>maxsize += 1;
>break;
>case SQLITE_INTEGER:
>maxsize += _varIntSize_(sqlite3_value_int64(argv[i])) +
>1;
>break;
>case SQLITE_FLOAT:
>maxsize += 9;
>break;
>case SQLITE_TEXT:
>sqlite3_value_blob(argv[i]);
>sz = sqlite3_value_bytes(argv[i]);
>maxsize += sz + _varIntSize_(sz*2+12);
>break;
>case SQLITE_BLOB:
>sz = sqlite3_value_bytes(argv[i]);
>maxsize += sz + _varIntSize_(sz*2+13);
>break;
>}
>}
>sqlite3_result_int64(context, maxsize); }
>
>#ifdef _WIN32
>#ifndef SQLITE_CORE
>__declspec(dllexport)
>#endif
>#endif
>int sqlite3_sqlsize_init(sqlite3 *db, char **pzErrMsg, const
>sqlite3_api_routines *pApi) {
>SQLITE_EXTENSION_INIT2(pApi);
>
>return sqlite3_create_function(db, "recsize", -1,
>SQLITE_ANY|SQLITE_DETERMINISTIC|SQLITE_INNOCUOUS,  0, _recSizeFunc, 0,
>0); }
>-//-
>
>It is a bit of a PITA to call, but thats how the cookie crumbles ...
>
>>sqlite3 

Re: [sqlite] SQL CASE WHEN THEN ELSE END

2020-01-27 Thread Jose Isaias Cabrera

Keith Medcalf, on Sunday, January 26, 2020 11:19 PM, wrote...
>
>
> I get nothing at all except a complaint that the syntax is invalid. In
> particular
>
> (
> CASE
> (
>   SELECT WYear FROM t2 WHERE pid = a.a
> )
> WHEN c.WYear = 2020 THEN “YES”
> ELSE “NO” END
> ) AS DIGITAL
>
> Is not a valid scalar expression. Parsing fails at "WHEN".

This one does not give a syntax error and provides a result:

SELECT a.a, a.c, a.e, b.g, b.h, b.i,
(
CASE
(SELECT c.WYear FROM t2 WHERE pid = a.a)
WHEN c.WYear = 2020 THEN “YES” ELSE “NO” END
) AS DIGITAL
FROM t0 as a, t1 as b, t2 as c
WHERE a.a = b.f and a.a = c.pid
AND a.c = 2020
AND a.idate = (SELECT MAX(idate) from t0 where a = a.a)
AND b.idate = (SELECT MAX(idate) from t1 where f = a.a)
GROUP BY a.a
;

But, it gives me the wrong result.  I must have placed one of my many 
variations in the email with a syntax error.

> What exactly
> do you intend this scalar expression to do?

The idea is that if the pid is found in t2 with the same WYear (2020) I wanted 
to add YES to DIGITAL. Igor provided the solution.  For some reason I thought 
that I needed to give the full select to the CASE function.


> (and if the syntax was not invalid, the result would always be NO since
> it is impossible for the result of the subselect (which will always be a 4
> digit number because that is all that is in t2, or null, if not found (and
> a random year at that since there can be multiple rows with the same pid
> and you did not specify which one you want)) to be equal to the 0 or 1
> (true or false) boolean expression after the WHEN.

I must have given the wrong
> The fact that there's a Highway to Hell but only a Stairway to Heaven
> says a lot about anticipated traffic volume.
>
> >-Original Message-
> >From: sqlite-users  On
> >Behalf Of Jose Isaias Cabrera
> >Sent: Sunday, 26 January, 2020 19:44
> >To: SQLite mailing list 
> >Subject: [sqlite] SQL CASE WHEN THEN ELSE END
> >
> >
> >Greetings!
> >
> >I am getting the wrong output, and I don't know how to get it to work.
> >Please take a look at the following (Pardon the lengthy data):
> >create table t0 (n INTEGER PRIMARY KEY, a, b, c, d, e, idate);
> >insert into t0 (a, b, c, d, e, idate) values ('p001', 1, 2019, 'n', 4,
> >'2019-02-11');
> >insert into t0 (a, b, c, d, e, idate) values ('p002', 2, 2019, 'n', 4,
> >'2019-02-11');
> >insert into t0 (a, b, c, d, e, idate) values ('p003', 3, 2019, 'n', 4,
> >'2019-02-11');
> >insert into t0 (a, b, c, d, e, idate) values ('p004', 4, 2019, 'y', 4,
> >'2019-02-11');
> >insert into t0 (a, b, c, d, e, idate) values ('p005', 5, 2019, 'y', 4,
> >'2019-02-11');
> >insert into t0 (a, b, c, d, e, idate) values ('p001', 10, 2020, 'n', 4,
> >'2019-02-12');
> >insert into t0 (a, b, c, d, e, idate) values ('p002', 2, 2019, 'n', 4,
> >'2019-02-12');
> >insert into t0 (a, b, c, d, e, idate) values ('p003', 3, 2019, 'y', 4,
> >'2019-02-12');
> >insert into t0 (a, b, c, d, e, idate) values ('p004', 4, 2019, 'y', 4,
> >'2019-02-12');
> >insert into t0 (a, b, c, d, e, idate) values ('p005', 5, 2019, 'y', 4,
> >'2019-02-12');
> >insert into t0 (a, b, c, d, e, idate) values ('p001', 10, 2020, 'n', 4,
> >'2019-02-13');
> >insert into t0 (a, b, c, d, e, idate) values ('p002', 2, 2019, 'n', 4,
> >'2019-02-13');
> >insert into t0 (a, b, c, d, e, idate) values ('p003', 3, 2020, 'y', 4,
> >'2019-02-13');
> >insert into t0 (a, b, c, d, e, idate) values ('p004', 5, 2019, 'n', 4,
> >'2019-02-13');
> >insert into t0 (a, b, c, d, e, idate) values ('p005', 5, 2020, 'y', 8,
> >'2019-02-13');
> >
> >create table t1 (n INTEGER PRIMARY KEY, f, g, h, i, j, idate);
> >insert into t1 (f, g, h, i, j, idate) values ('p001', 1, 4, 'n', 4,
> >'2019-02-11');
> >insert into t1 (f, g, h, i, j, idate) values ('p002', 2, 3, 'n', 4,
> >'2019-02-11');
> >insert into t1 (f, g, h, i, j, idate) values ('p003', 3, 2, 'n', 4,
> >'2019-02-11');
> >insert into t1 (f, g, h, i, j,  idate) values ('p004', 4, 5, 'y', 4,
> >'2019-02-11');
> >insert into t1 (f, g, h, i, j, idate) values ('p005', 5, 3, 'y', 4,
> >'2019-02-11');
> >insert into t1 (f, g, h, i, j, idate) values ('p001', 10, 2, 'n', 4,
> >'2019-02-12');
> >insert into t1 (f, g, h, i, j, idate) values ('p002', 2, 6, 'n', 4,
> >'2019-02-12');
> >insert into t1 (f, g, h, i, j, idate) values ('p003', 3, 7, 'y', 4,
> >'2019-02-12');
> >insert into t1 (f, g, h, i, j, idate) values ('p004', 4, 1, 'y', 4,
> >'2019-02-12');
> >insert into t1 (f, g, h, i, j, idate) values ('p005', 5, 2, 'y', 4,
> >'2019-02-12');
> >insert into t1 (f, g, h, i, j, idate) values ('p001', 10, 1, 'n', 4,
> >'2019-02-13');
> >insert into t1 (f, g, h, i, j, idate) values ('p002', 2, 8, 'n', 4,
> >'2019-02-13');
> >insert into t1 (f, g, h, i, j, idate) values ('p003', 3, 9, 'y', 4,
> >'2019-02-13');
> >insert into t1 (f, g, h, i, j, idate) values ('p004', 5, 3, 'n', 4,
> >'2019-02-13');
> >insert into t1 (f, g, h, i, j, idate) values ('p005', 5, 3, 'y', 8,
> >'2019-02-13');
> >
> 

Re: [sqlite] SQL CASE WHEN THEN ELSE END

2020-01-27 Thread Jose Isaias Cabrera


Simon Slavin, on Sunday, January 26, 2020 09:59 PM, wrote...
>
> On 27 Jan 2020, at 2:44am, Jose Isaias Cabrera 
> wrote:
>
> > CASE
> >(
> >  SELECT WYear FROM t2 WHERE pid = a.a
> >)
> >WHEN c.WYear = 2020 THEN “YES”
> >ELSE “NO” END
>
> That's not the structure of a CASE statement.
>
> After CASE comes an expression.
> After WHEN comes another expression.
> If they equal one another, then the the bit after the THEN is returned.
>
> You want something more like
>
> SELECT
> (CASE WYear WHEN 2020 THEN 'YES' ELSE 'NO' END) AS DIGITAL
> FROM t2 WHERE pid = a.a
>
> but you'll have to fit this in with how your overall SELECT works.
>
> Sse "The CASE expression" on this page for more details:
>
> 

Thanks.

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


Re: [sqlite] [EXTERNAL] Re: Row length in SQLITE

2020-01-27 Thread Hick Gunter
You are missing

maxsize += _varIntSize_(maxsize)

fort he size varint at the begin oft he header just before the return

-Ursprüngliche Nachricht-
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Keith Medcalf
Gesendet: Montag, 27. Januar 2020 12:43
An: SQLite mailing list 
Betreff: [EXTERNAL] Re: [sqlite] Row length in SQLITE


Here is a wee bit of C code that you can compile as a plugin that will give you 
the row size (well, it may be bigger than the actual record size by a few bytes 
but it is pretty close) ...

works properly for utf-16 encoded databases as well.

-//- sqlsize.c -//-
#include "sqlite3ext.h"
SQLITE_EXTENSION_INIT1

#ifndef SQLITE_PRIVATE
#define SQLITE_PRIVATE static
#endif

static inline sqlite_int64 _varIntSize_(sqlite_int64 v) {
sqlite_int64 uu;

if (v<0)
uu = ~v;
else
uu = v;
if (uu <= 127 )
return 1;
else if (uu <= 32767)
return 2;
else if (uu <= 8388607)
return 3;
else if (uu <= 2147483647)
return 4;
else if (uu <= 140737488355327LL)
return 6;
else return 8;
}

SQLITE_PRIVATE void _recSizeFunc(sqlite3_context *context, int argc, 
sqlite3_value **argv) {
sqlite_int64 maxsize = 0;
sqlite_int64 sz;
int i;

for (i=0; isqlite3 \data\apps\splunk\splunk.db
SQLite version 3.31.0 2020-01-27 11:17:22 Enter ".help" for usage hints.
sqlite> .schema details
CREATE TABLE Details
(
ApplianceID integer not null references Appliances(ApplianceID) on 
delete cascade,
SrcIntIDinteger not null references Interfaces(InterfaceID) on 
delete cascade,
DstIntIDinteger not null references Interfaces(InterfaceID) on 
delete cascade,
Transport   text not null collate nocase,
SrcHostID   integer not null references Hosts(HostID) on delete cascade,
SrcPort integer not null,
DstHostID   integer not null references Hosts(HostID) on delete cascade,
DstPort integer not null,
Action  integer not null,
Count   integer not null,
FileID  integer not null references Files(FileID) on delete cascade
);
sqlite> select _rowid_, recsize(ApplianceID, SrcIntID, DstIntID,
sqlite> Transport, SrcHostID, SrcPort, DstHostID, DstPort, Action,
sqlite> Count, FileID) from details limit 10;
1|27
2|27
3|27
4|27
5|27
6|28
7|27
8|27
9|28
10|27
sqlite> select max(recsize(ApplianceID, SrcIntID, DstIntID, Transport,
sqlite> SrcHostID, SrcPort, DstHostID, DstPort, Action, Count, FileID))
sqlite> from details;
31
sqlite> select avg(recsize(ApplianceID, SrcIntID, DstIntID, Transport,
sqlite> SrcHostID, SrcPort, DstHostID, DstPort, Action, Count, FileID))
sqlite> from details;
29.4473800800817
sqlite> select min(recsize(ApplianceID, SrcIntID, DstIntID, Transport,
sqlite> SrcHostID, SrcPort, DstHostID, DstPort, Action, Count, FileID))
sqlite> from details;
26
sqlite> select skew(recsize(ApplianceID, SrcIntID, DstIntID, Transport,
sqlite> SrcHostID, SrcPort, DstHostID, DstPort, Action, Count, FileID))
sqlite> from details;
-0.378384651017371
sqlite> select kurt(recsize(ApplianceID, SrcIntID, DstIntID, Transport,
sqlite> SrcHostID, SrcPort, DstHostID, DstPort, Action, Count, FileID))
sqlite> from details;
0.130516904446944

--
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.

>-Original Message-
>From: sqlite-users  On
>Behalf Of Deon Brewis
>Sent: Friday, 24 January, 2020 21:14
>To: SQLite mailing list 
>Subject: Re: [sqlite] Row length in SQLITE
>
>No I mean e.g.
>
>row 1 = 500 bytes,
>row 2 = 600 bytes
>row 3 = 80 bytes
>row 4 = 300 bytes
>
>etc.
>
>Like the info that DBSTAT gives, but per row, not per page. This
>doesn't need to be performant - it's for usage analysis during development 
>time.
>
>- Deon
>
>-Original Message-
>From: sqlite-users  On
>Behalf Of Simon Slavin
>Sent: Wednesday, January 22, 2020 5:24 PM
>To: SQLite mailing list 
>Subject: Re: [sqlite] Row length in SQLITE
>
>On 22 Jan 2020, at 11:44pm, Deon Brewis  wrote:
>
>> Is there any way to get the length of rows in a table / index in
>sqlite?
>
>Do you mean the count of rows in a table / index ?
>
>   SELECT count(*) FROM MyTable
>
>There's no easy fast way to do this because SQLite doesn't keep that
>number handy anywhere.  It stores the entries in a tree and it would
>have to manually count the leaves of the tree.
>
>
>
>Or do you mean the count of columns in a table / index ?
>
>SELECT * FROM MyTable LIMIT 1
>
>and count the number of columns returned.  Or in C
>
>sqlite3_column_count()
>___
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>___
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org

[sqlite] sqlite-3.31.0 segfaults on fuzzcheck on s390x architectures

2020-01-27 Thread Ondrej Dubaj
Hi,

I came across a problem during mate test, where fuzzcheck ends with
segfault.
The problem appears to be only on this arches. Other architectures are
working fine.

Build here:

https://koji.fedoraproject.org/koji/taskinfo?taskID=40950404

Log:

./fuzzcheck /builddir/build/BUILD/sqlite-src-331/test/fuzzdata1.db
/builddir/build/BUILD/sqlite-src-331/test/fuzzdata2.db
/builddir/build/BUILD/sqlite-src-331/test/fuzzdata3.db
/builddir/build/BUILD/sqlite-src-331/test/fuzzdata4.db
/builddir/build/BUILD/sqlite-src-331/test/fuzzdata5.db
/builddir/build/BUILD/sqlite-src-331/test/fuzzdata6.db
/builddir/build/BUILD/sqlite-src-331/test/fuzzdata7.db
/builddir/build/BUILD/sqlite-src-331/test/fuzzdata8.db
fuzzdata1.db: SQL fuzz
fuzzdata1.db: 0% 10% 20% 30% 40% 50% 60% 70%./fuzzcheck
/builddir/build/BUILD/sqlite-src-331/test/fuzzdata1.db
(sqlid=7726,dbid=1): segfault
make: *** [Makefile:1242: fuzztest] Error 1

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


Re: [sqlite] Row length in SQLITE

2020-01-27 Thread Keith Medcalf

Here is a wee bit of C code that you can compile as a plugin that will give you 
the row size (well, it may be bigger than the actual record size by a few bytes 
but it is pretty close) ... 

works properly for utf-16 encoded databases as well.

-//- sqlsize.c -//-
#include "sqlite3ext.h"
SQLITE_EXTENSION_INIT1

#ifndef SQLITE_PRIVATE
#define SQLITE_PRIVATE static
#endif

static inline sqlite_int64 _varIntSize_(sqlite_int64 v)
{
sqlite_int64 uu;

if (v<0)
uu = ~v;
else
uu = v;
if (uu <= 127 )
return 1;
else if (uu <= 32767)
return 2;
else if (uu <= 8388607)
return 3;
else if (uu <= 2147483647)
return 4;
else if (uu <= 140737488355327LL)
return 6;
else return 8;
}

SQLITE_PRIVATE void _recSizeFunc(sqlite3_context *context, int argc, 
sqlite3_value **argv)
{
sqlite_int64 maxsize = 0;
sqlite_int64 sz;
int i;

for (i=0; isqlite3 \data\apps\splunk\splunk.db
SQLite version 3.31.0 2020-01-27 11:17:22
Enter ".help" for usage hints.
sqlite> .schema details
CREATE TABLE Details
(
ApplianceID integer not null references Appliances(ApplianceID) on 
delete cascade,
SrcIntIDinteger not null references Interfaces(InterfaceID) on 
delete cascade,
DstIntIDinteger not null references Interfaces(InterfaceID) on 
delete cascade,
Transport   text not null collate nocase,
SrcHostID   integer not null references Hosts(HostID) on delete cascade,
SrcPort integer not null,
DstHostID   integer not null references Hosts(HostID) on delete cascade,
DstPort integer not null,
Action  integer not null,
Count   integer not null,
FileID  integer not null references Files(FileID) on delete cascade
);
sqlite> select _rowid_, recsize(ApplianceID, SrcIntID, DstIntID, Transport, 
SrcHostID, SrcPort, DstHostID, DstPort, Action, Count, FileID) from details 
limit 10;
1|27
2|27
3|27
4|27
5|27
6|28
7|27
8|27
9|28
10|27
sqlite> select max(recsize(ApplianceID, SrcIntID, DstIntID, Transport, 
SrcHostID, SrcPort, DstHostID, DstPort, Action, Count, FileID)) from details;
31
sqlite> select avg(recsize(ApplianceID, SrcIntID, DstIntID, Transport, 
SrcHostID, SrcPort, DstHostID, DstPort, Action, Count, FileID)) from details;
29.4473800800817
sqlite> select min(recsize(ApplianceID, SrcIntID, DstIntID, Transport, 
SrcHostID, SrcPort, DstHostID, DstPort, Action, Count, FileID)) from details;
26
sqlite> select skew(recsize(ApplianceID, SrcIntID, DstIntID, Transport, 
SrcHostID, SrcPort, DstHostID, DstPort, Action, Count, FileID)) from details;
-0.378384651017371
sqlite> select kurt(recsize(ApplianceID, SrcIntID, DstIntID, Transport, 
SrcHostID, SrcPort, DstHostID, DstPort, Action, Count, FileID)) from details;
0.130516904446944

-- 
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.

>-Original Message-
>From: sqlite-users  On
>Behalf Of Deon Brewis
>Sent: Friday, 24 January, 2020 21:14
>To: SQLite mailing list 
>Subject: Re: [sqlite] Row length in SQLITE
>
>No I mean e.g.
>
>row 1 = 500 bytes,
>row 2 = 600 bytes
>row 3 = 80 bytes
>row 4 = 300 bytes
>
>etc.
>
>Like the info that DBSTAT gives, but per row, not per page. This doesn't
>need to be performant - it's for usage analysis during development time.
>
>- Deon
>
>-Original Message-
>From: sqlite-users  On
>Behalf Of Simon Slavin
>Sent: Wednesday, January 22, 2020 5:24 PM
>To: SQLite mailing list 
>Subject: Re: [sqlite] Row length in SQLITE
>
>On 22 Jan 2020, at 11:44pm, Deon Brewis  wrote:
>
>> Is there any way to get the length of rows in a table / index in
>sqlite?
>
>Do you mean the count of rows in a table / index ?
>
>   SELECT count(*) FROM MyTable
>
>There's no easy fast way to do this because SQLite doesn't keep that
>number handy anywhere.  It stores the entries in a tree and it would have
>to manually count the leaves of the tree.
>
>
>
>Or do you mean the count of columns in a table / index ?
>
>SELECT * FROM MyTable LIMIT 1
>
>and count the number of columns returned.  Or in C
>
>sqlite3_column_count()
>___
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>___
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



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


Re: [sqlite] Row length in SQLITE

2020-01-27 Thread Keith Medcalf

You can certainly get the max and average cell size per page of rows from 
dbstat which is the most granular data available I think, as well as the 
average and max for all the rows taken together.  Assuming that the table is a 
"rowid" table, then that is the data for the "leaf" pages only.  As in:

   select Schema,
  Name,
  PageNo,
  ncell as nrows,
  payload / ncell as avglen,
  mx_payload as maxlen,
  payload as payload,
  unused as unused,
  pgsize as total
 from dbStat
where PageType == 'leaf'
  and Schema == 'main'
  and Name == 'Details'
union all
   select Schema,
  Name,
  'All',
  sum(ncell) as nrows,
  sum(payload) / sum(ncell) as avglen,
  max(mx_payload) as maxlen,
  sum(payload) as payload,
  sum(unused) as unused,
  sum(pgsize) as total
 from dbStat
where PageType == 'leaf'
  and Schema == 'main'
  and Name == 'Details'
;

The row size will not vary by alot unless the table contains 'text' or 'blob' 
column data.  The schema and summary for the above table looks like this:

CREATE TABLE Details
(
ApplianceID integer not null references Appliances(ApplianceID) on 
delete cascade,
SrcIntIDinteger not null references Interfaces(InterfaceID) on 
delete cascade,
DstIntIDinteger not null references Interfaces(InterfaceID) on 
delete cascade,
Transport   text not null collate nocase,
SrcHostID   integer not null references Hosts(HostID) on delete cascade,
SrcPort integer not null,
DstHostID   integer not null references Hosts(HostID) on delete cascade,
DstPort integer not null,
Action  integer not null,
Count   integer not null,
FileID  integer not null references Files(FileID) on delete cascade
);

schema  name'All'   nrows   avglen  maxlen  payload 
unused  total
--  --  --  --  --  --  
--  --  --
mainDetails All 1160835127  31  
321835482   1851729 404230144

which indicates that all the rows are about the same size and the average is 27 
bytes, which is somewhat less than the 95 bytes max I would expect per row if 
the integers were all stored as 8 byte integers.

Are you trying to find rows that have "wacky large" data (as in blob/text) 
stored in them?

-- 
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.

>-Original Message-
>From: sqlite-users  On
>Behalf Of Deon Brewis
>Sent: Friday, 24 January, 2020 21:14
>To: SQLite mailing list 
>Subject: Re: [sqlite] Row length in SQLITE
>
>No I mean e.g.
>
>row 1 = 500 bytes,
>row 2 = 600 bytes
>row 3 = 80 bytes
>row 4 = 300 bytes
>
>etc.
>
>Like the info that DBSTAT gives, but per row, not per page. This doesn't
>need to be performant - it's for usage analysis during development time.
>
>- Deon
>
>-Original Message-
>From: sqlite-users  On
>Behalf Of Simon Slavin
>Sent: Wednesday, January 22, 2020 5:24 PM
>To: SQLite mailing list 
>Subject: Re: [sqlite] Row length in SQLITE
>
>On 22 Jan 2020, at 11:44pm, Deon Brewis  wrote:
>
>> Is there any way to get the length of rows in a table / index in
>sqlite?
>
>Do you mean the count of rows in a table / index ?
>
>   SELECT count(*) FROM MyTable
>
>There's no easy fast way to do this because SQLite doesn't keep that
>number handy anywhere.  It stores the entries in a tree and it would have
>to manually count the leaves of the tree.
>
>
>
>Or do you mean the count of columns in a table / index ?
>
>SELECT * FROM MyTable LIMIT 1
>
>and count the number of columns returned.  Or in C
>
>sqlite3_column_count()
>___
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>___
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



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


Re: [sqlite] SQL CASE WHEN THEN ELSE END

2020-01-27 Thread Keith Medcalf

This version generates the most efficient query plan in 3.31.0 when you have 
indexes on the necessary columns:

CREATE INDEX t0_1 on t0 (a, idate, c); -- c does not have to be in the index
CREATE INDEX t1_1 on t1 (f, idate);
CREATE INDEX t2_1 on t2 (pid, wyear); -- this could be a without rowid table 
with both columns in the primary key

with keys (pid, idate0, idate1)
  as (
  select distinct pid,
 (
  select max(idate)
from t0
   where a == pid
 ),
 (
  select max(idate)
from t1
   where f == pid
 )
from (
  select distinct pid
from t2
 )
 )
  SELECT a.a,
 a.c,
 a.e,
 b.g,
 b.h,
 b.i,
 coalesce((
   SELECT 'YES'
 FROM t2
WHERE wYear == a.c
  AND pid == a.a
  ),  'NO') AS digital
FROM t0 as a, t1 as b, keys
   WHERE a.a == keys.pid
 AND b.f == keys.pid
 AND a.idate == keys.idate0
 AND b.idate == keys.idate1
 AND a.c == 2020
;

without help the query planner does not seem to generate a very good plan but 
maybe that is because the sample data is so small ... or maybe it does and I 
cannot tell with such small data ... but this forces the query to execute in 
the manner I think it should.  If you take the "distinct" from the keys select 
it frees up the query planner to perhaps find a better plan -- you need the 
"select distinct pid from t2" to prevent duplicate rows.

-- 
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.

>-Original Message-
>From: sqlite-users  On
>Behalf Of Keith Medcalf
>Sent: Monday, 27 January, 2020 00:28
>To: SQLite mailing list 
>Subject: Re: [sqlite] SQL CASE WHEN THEN ELSE END
>
>
>Do you perhaps mean:
>
>  SELECT a.a,
> a.c,
> a.e,
> b.g,
> b.h,
> b.i,
> coalesce((
>   SELECT 'YES'
> FROM t2
>WHERE wYear == a.c
>  AND pid == a.a
>  ),  'NO') AS digital
>FROM t0 as a, t1 as b
>   WHERE a.a == b.f
> AND a.idate == (SELECT MAX(idate) from t0 where a = a.a)
> AND b.idate == (SELECT MAX(idate) from t1 where f = a.a)
> AND a.a IN (SELECT pid FROM t2)
> AND a.c == 2020
>;
>
>--
>The fact that there's a Highway to Hell but only a Stairway to Heaven
>says a lot about anticipated traffic volume.
>
>>-Original Message-
>>From: sqlite-users  On
>>Behalf Of Jose Isaias Cabrera
>>Sent: Sunday, 26 January, 2020 19:44
>>To: SQLite mailing list 
>>Subject: [sqlite] SQL CASE WHEN THEN ELSE END
>>
>>
>>Greetings!
>>
>>I am getting the wrong output, and I don't know how to get it to work.
>>Please take a look at the following (Pardon the lengthy data):
>>create table t0 (n INTEGER PRIMARY KEY, a, b, c, d, e, idate);
>>insert into t0 (a, b, c, d, e, idate) values ('p001', 1, 2019, 'n', 4,
>>'2019-02-11');
>>insert into t0 (a, b, c, d, e, idate) values ('p002', 2, 2019, 'n', 4,
>>'2019-02-11');
>>insert into t0 (a, b, c, d, e, idate) values ('p003', 3, 2019, 'n', 4,
>>'2019-02-11');
>>insert into t0 (a, b, c, d, e, idate) values ('p004', 4, 2019, 'y', 4,
>>'2019-02-11');
>>insert into t0 (a, b, c, d, e, idate) values ('p005', 5, 2019, 'y', 4,
>>'2019-02-11');
>>insert into t0 (a, b, c, d, e, idate) values ('p001', 10, 2020, 'n', 4,
>>'2019-02-12');
>>insert into t0 (a, b, c, d, e, idate) values ('p002', 2, 2019, 'n', 4,
>>'2019-02-12');
>>insert into t0 (a, b, c, d, e, idate) values ('p003', 3, 2019, 'y', 4,
>>'2019-02-12');
>>insert into t0 (a, b, c, d, e, idate) values ('p004', 4, 2019, 'y', 4,
>>'2019-02-12');
>>insert into t0 (a, b, c, d, e, idate) values ('p005', 5, 2019, 'y', 4,
>>'2019-02-12');
>>insert into t0 (a, b, c, d, e, idate) values ('p001', 10, 2020, 'n', 4,
>>'2019-02-13');
>>insert into t0 (a, b, c, d, e, idate) values ('p002', 2, 2019, 'n', 4,
>>'2019-02-13');
>>insert into t0 (a, b, c, d, e, idate) values ('p003', 3, 2020, 'y', 4,
>>'2019-02-13');
>>insert into t0 (a, b, c, d, e, idate) values ('p004', 5, 2019, 'n', 4,
>>'2019-02-13');
>>insert into t0 (a, b, c, d, e, idate) values ('p005', 5, 2020, 'y', 8,
>>'2019-02-13');
>>
>>create table t1 (n INTEGER PRIMARY KEY, f, g, h, i, j, idate);
>>insert into t1 (f, g, h, i, j, idate) values ('p001', 1, 4, 'n', 4,
>>'2019-02-11');
>>insert into t1 (f, g, h, i, j, idate) values ('p002', 2, 3, 'n', 4,
>>'2019-02-11');
>>insert into t1 (f, g, h, i, j, idate) values ('p003', 3, 2, 'n', 4,
>>'2019-02-11');
>>insert into t1 (f, g, h, i, j,  idate) values ('p004', 4, 5, 'y', 4,
>>'2019-02-11');
>>insert into t1 (f, g, h, i, j, idate) values ('p005', 5, 3, 'y', 4,
>>'2019-02-11');
>>insert into t1 (f, g, h, i, j, idate) values ('p001', 10, 2, 'n', 4,

Re: [sqlite] [EXTERNAL] Re: Row length in SQLITE

2020-01-27 Thread Hick Gunter
As previously mentioned, SQLite uses a compressed format to store rows. You 
would have to reverse engineer at least the calculation

-Ursprüngliche Nachricht-
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Deon Brewis
Gesendet: Samstag, 25. Januar 2020 05:14
An: SQLite mailing list 
Betreff: [EXTERNAL] Re: [sqlite] Row length in SQLITE

No I mean e.g.

row 1 = 500 bytes,
row 2 = 600 bytes
row 3 = 80 bytes
row 4 = 300 bytes

etc.

Like the info that DBSTAT gives, but per row, not per page. This doesn't need 
to be performant - it's for usage analysis during development time.

- Deon

-Original Message-
From: sqlite-users  On Behalf Of 
Simon Slavin
Sent: Wednesday, January 22, 2020 5:24 PM
To: SQLite mailing list 
Subject: Re: [sqlite] Row length in SQLITE

On 22 Jan 2020, at 11:44pm, Deon Brewis  wrote:

> Is there any way to get the length of rows in a table / index in sqlite?

Do you mean the count of rows in a table / index ?

   SELECT count(*) FROM MyTable

There's no easy fast way to do this because SQLite doesn't keep that number 
handy anywhere.  It stores the entries in a tree and it would have to manually 
count the leaves of the tree.



Or do you mean the count of columns in a table / index ?

SELECT * FROM MyTable LIMIT 1

and count the number of columns returned.  Or in C

sqlite3_column_count()
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users