Can an SQL script be built from within sqlite?

classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Can an SQL script be built from within sqlite?

Shane Dev
Hello,

I have a table of dot commands and SQL -

sqlite> select sql from tcout1;
sql
.headers off
select '.once tc'||strftime('%s','now'); --first execute this SQL statement
and replace this line with its own result
select * from tc;

Is there a way to execute the contents of certain rows (the second row in
this example) and replace it with its own result to create second table /
view which could interpreted by the sqlite shell?

sqlite> select sql from tcout2;
sql
.headers off
.once tc1515867712
select * from tc;
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Simon Slavin-3
On 13 Jan 2018, at 6:48pm, Shane Dev <[hidden email]> wrote:

> Is there a way to execute the contents of certain rows (the second row in
> this example) and replace it with its own result to create second table /
> view which could interpreted by the sqlite shell?

Not inside the SQLite shell.

Looks like you need to learn programming.  Or at least how to script your OS shell.  Which OS are you using ?  And if it’s Linux/Unix, which shell are you using ?

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Shane Dev
Hi Simon,

I use mainly Linux (bash) and Windows (powershell) but my target platforms
also include Android, iOS, IoT (anything that can link against the sqlite
library). At this stage, I am trying to prototype as much as possible using
only the SQLite shell.



On 13 January 2018 at 19:57, Simon Slavin <[hidden email]> wrote:

> On 13 Jan 2018, at 6:48pm, Shane Dev <[hidden email]> wrote:
>
> > Is there a way to execute the contents of certain rows (the second row in
> > this example) and replace it with its own result to create second table /
> > view which could interpreted by the sqlite shell?
>
> Not inside the SQLite shell.
>
> Looks like you need to learn programming.  Or at least how to script your
> OS shell.  Which OS are you using ?  And if it’s Linux/Unix, which shell
> are you using ?
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Simon Slavin-3


On 13 Jan 2018, at 7:33pm, Shane Dev <[hidden email]> wrote:

> I use mainly Linux (bash) and Windows (powershell) but my target platforms
> also include Android, iOS, IoT (anything that can link against the sqlite
> library). At this stage, I am trying to prototype as much as possible using
> only the SQLite shell.

Your theory is sound.  You should be able to build a SQL command using the results from another SQL command.  But there must be a way to express your SELECT in a way which doesn’t require the indirect phase, and your command looks especially simple.

Can you post what the results of

        select '.once tc'||strftime('%s','now');

are expected to look like ?

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Shane Dev
Hi Simion,

What do you mean by 'indirect phase'?

The results of execution -

sqlite> select '.once tc'||strftime('%s','now');
.once tc1515872821
sqlite>

obviously the numeric part of the file name will change depending on the
time of statement execution - or do I misunderstand your question?


On 13 January 2018 at 20:40, Simon Slavin <[hidden email]> wrote:

>
>
> On 13 Jan 2018, at 7:33pm, Shane Dev <[hidden email]> wrote:
>
> > I use mainly Linux (bash) and Windows (powershell) but my target
> platforms
> > also include Android, iOS, IoT (anything that can link against the sqlite
> > library). At this stage, I am trying to prototype as much as possible
> using
> > only the SQLite shell.
>
> Your theory is sound.  You should be able to build a SQL command using the
> results from another SQL command.  But there must be a way to express your
> SELECT in a way which doesn’t require the indirect phase, and your command
> looks especially simple.
>
> Can you post what the results of
>
>         select '.once tc'||strftime('%s','now');
>
> are expected to look like ?
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Simon Slavin-3


On 13 Jan 2018, at 7:54pm, Shane Dev <[hidden email]> wrote:

> What do you mean by 'indirect phase'?

Having to execute a command to find the command you want to execute.

> The results of execution -
>
> sqlite> select '.once tc'||strftime('%s','now');
> .once tc1515872821
> sqlite>
>
> obviously the numeric part of the file name will change depending on the
> time of statement execution - or do I misunderstand your question?

So the purpose of this is to find compose a filename which includes a timestamp ?

For prototype purposes you should be able to do this in whatever shell you’re using to run the SQLite shell tool.  For real project uses you should be doing it in whatever language your programming in, of course.

You can’t use the SQLite shell tool for real project purposes on multiple platforms.  It won’t run on many IoT devices, of course.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Shane Dev
Yes, I want to create a timestamp in the file name. My goal is to test the
prototype on at least Windows, Linux, iOS and Android. Of course this kind
of string building is easily done in bash, powershell, python, etc but no
single scripting environment is available on every target platform. It
could be done in C/C++ on every target platform but I was hoping to avoid
the complexities of the compiler toolchain and system programming languages
at this stage.

On 13 January 2018 at 21:09, Simon Slavin <[hidden email]> wrote:

>
>
> On 13 Jan 2018, at 7:54pm, Shane Dev <[hidden email]> wrote:
>
> > What do you mean by 'indirect phase'?
>
> Having to execute a command to find the command you want to execute.
>
> > The results of execution -
> >
> > sqlite> select '.once tc'||strftime('%s','now');
> > .once tc1515872821
> > sqlite>
> >
> > obviously the numeric part of the file name will change depending on the
> > time of statement execution - or do I misunderstand your question?
>
> So the purpose of this is to find compose a filename which includes a
> timestamp ?
>
> For prototype purposes you should be able to do this in whatever shell
> you’re using to run the SQLite shell tool.  For real project uses you
> should be doing it in whatever language your programming in, of course.
>
> You can’t use the SQLite shell tool for real project purposes on multiple
> platforms.  It won’t run on many IoT devices, of course.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Brian Curley
Bash can be found on prettt much all of these platforms if you're only
prototyping in the shell. Even Windows offers Cygwin, Git, and Msys2
versions of the bash shell and I've had good success in running these w
SQLite. (I cannot speak for iOS and bash, but I'm sure there's an option...)

You can then adopt forward to others like Python, Node.js, whatever...

Regards.

Brian P Curley



On Jan 13, 2018 4:18 PM, "Shane Dev" <[hidden email]> wrote:

Yes, I want to create a timestamp in the file name. My goal is to test the
prototype on at least Windows, Linux, iOS and Android. Of course this kind
of string building is easily done in bash, powershell, python, etc but no
single scripting environment is available on every target platform. It
could be done in C/C++ on every target platform but I was hoping to avoid
the complexities of the compiler toolchain and system programming languages
at this stage.

On 13 January 2018 at 21:09, Simon Slavin <[hidden email]> wrote:

>
>
> On 13 Jan 2018, at 7:54pm, Shane Dev <[hidden email]> wrote:
>
> > What do you mean by 'indirect phase'?
>
> Having to execute a command to find the command you want to execute.
>
> > The results of execution -
> >
> > sqlite> select '.once tc'||strftime('%s','now');
> > .once tc1515872821
> > sqlite>
> >
> > obviously the numeric part of the file name will change depending on the
> > time of statement execution - or do I misunderstand your question?
>
> So the purpose of this is to find compose a filename which includes a
> timestamp ?
>
> For prototype purposes you should be able to do this in whatever shell
> you’re using to run the SQLite shell tool.  For real project uses you
> should be doing it in whatever language your programming in, of course.
>
> You can’t use the SQLite shell tool for real project purposes on multiple
> platforms.  It won’t run on many IoT devices, of course.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

J Decker
I could do it in node.js pretty easy....
2 ways (I think).
```
var sack = require( "sack.vfs" );
var db = sack.Sqlite( "test.db" );

function type1( condition ) {
    db.do( `select sql from commands where
${db.escape(condition)}` ).forEach( record=>{ db.do( record.sql ) }` );
}

function type2( condition ) {
    db.aggregate( "run", ( sql )=>{ db.do( sql ) } );
    db.do( `select run(sql) from commands where ${condition}` );
}
```

using npmjs.org/packages/sack.vfs


On Sat, Jan 13, 2018 at 5:11 PM, Brian Curley <[hidden email]> wrote:

> Bash can be found on prettt much all of these platforms if you're only
> prototyping in the shell. Even Windows offers Cygwin, Git, and Msys2
> versions of the bash shell and I've had good success in running these w
> SQLite. (I cannot speak for iOS and bash, but I'm sure there's an
> option...)
>
> You can then adopt forward to others like Python, Node.js, whatever...
>
> Regards.
>
> Brian P Curley
>
>
>
> On Jan 13, 2018 4:18 PM, "Shane Dev" <[hidden email]> wrote:
>
> Yes, I want to create a timestamp in the file name. My goal is to test the
> prototype on at least Windows, Linux, iOS and Android. Of course this kind
> of string building is easily done in bash, powershell, python, etc but no
> single scripting environment is available on every target platform. It
> could be done in C/C++ on every target platform but I was hoping to avoid
> the complexities of the compiler toolchain and system programming languages
> at this stage.
>
> On 13 January 2018 at 21:09, Simon Slavin <[hidden email]> wrote:
>
> >
> >
> > On 13 Jan 2018, at 7:54pm, Shane Dev <[hidden email]> wrote:
> >
> > > What do you mean by 'indirect phase'?
> >
> > Having to execute a command to find the command you want to execute.
> >
> > > The results of execution -
> > >
> > > sqlite> select '.once tc'||strftime('%s','now');
> > > .once tc1515872821
> > > sqlite>
> > >
> > > obviously the numeric part of the file name will change depending on
> the
> > > time of statement execution - or do I misunderstand your question?
> >
> > So the purpose of this is to find compose a filename which includes a
> > timestamp ?
> >
> > For prototype purposes you should be able to do this in whatever shell
> > you’re using to run the SQLite shell tool.  For real project uses you
> > should be doing it in whatever language your programming in, of course.
> >
> > You can’t use the SQLite shell tool for real project purposes on multiple
> > platforms.  It won’t run on many IoT devices, of course.
> >
> > Simon.
> > _______________________________________________
> > sqlite-users mailing list
> > [hidden email]
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Shane Dev
In reply to this post by Simon Slavin-3
Hi Simon,

I have found a way achieve this purely in the SQLite shell. The trick is to
make all rows in tcout1 SQL statements and then execute them.

sqlite> CREATE TABLE tcout1(sql text);
sqlite> CREATE TABLE tcout2(sql text);
sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
'.headers off';";
sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
'.once tc'||strftime('%s','now');";
sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
'select * from tc;';";
sqlite> .once tcout1.sql
sqlite> select * from tcout1;
sqlite> .read tcout1.sql
sqlite> select * from tcout2;
.headers off
.once tc1515968593
select * from tc;


On 13 January 2018 at 19:57, Simon Slavin <[hidden email]> wrote:

> On 13 Jan 2018, at 6:48pm, Shane Dev <[hidden email]> wrote:
>
> > Is there a way to execute the contents of certain rows (the second row in
> > this example) and replace it with its own result to create second table /
> > view which could interpreted by the sqlite shell?
>
> Not inside the SQLite shell.
>
> Looks like you need to learn programming.  Or at least how to script your
> OS shell.  Which OS are you using ?  And if it’s Linux/Unix, which shell
> are you using ?
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Tony Papadimitriou
You can use .output file and .print for most cases (except those that need a
calculated result) to simplify your script a bit.

-----Original Message-----
From: Shane Dev

I have found a way achieve this purely in the SQLite shell. The trick is to
make all rows in tcout1 SQL statements and then execute them.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Simon Slavin-3
In reply to this post by Shane Dev
On 14 Jan 2018, at 10:33pm, Shane Dev <[hidden email]> wrote:

> I have found a way achieve this purely in the SQLite shell. The trick is to
> make all rows in tcout1 SQL statements and then execute them.

That’s clever.  Nice one.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

petern
In reply to this post by Shane Dev
Shane.  That's very interesting considering the effort to make the one
thing happen exactly once without external software dependency.
Does the capability to write specially named local files but not have a
periodic loop nor network capability somehow get your application off the
ground?
Based on your problem statement, the user would have to initiate your
script and know when/if it is required to be run...

I had in mind adding periodic and conditional dot commands to SQLite shell
- to simulate continuous operation of application code.  If you've figured
out a way around needing such things to make a useful standalone SQLite
application, I would be very interested to understand how that works.

Peter





On Sun, Jan 14, 2018 at 2:33 PM, Shane Dev <[hidden email]> wrote:

> Hi Simon,
>
> I have found a way achieve this purely in the SQLite shell. The trick is to
> make all rows in tcout1 SQL statements and then execute them.
>
> sqlite> CREATE TABLE tcout1(sql text);
> sqlite> CREATE TABLE tcout2(sql text);
> sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
> '.headers off';";
> sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
> '.once tc'||strftime('%s','now');";
> sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
> 'select * from tc;';";
> sqlite> .once tcout1.sql
> sqlite> select * from tcout1;
> sqlite> .read tcout1.sql
> sqlite> select * from tcout2;
> .headers off
> .once tc1515968593
> select * from tc;
>
>
> On 13 January 2018 at 19:57, Simon Slavin <[hidden email]> wrote:
>
> > On 13 Jan 2018, at 6:48pm, Shane Dev <[hidden email]> wrote:
> >
> > > Is there a way to execute the contents of certain rows (the second row
> in
> > > this example) and replace it with its own result to create second
> table /
> > > view which could interpreted by the sqlite shell?
> >
> > Not inside the SQLite shell.
> >
> > Looks like you need to learn programming.  Or at least how to script your
> > OS shell.  Which OS are you using ?  And if it’s Linux/Unix, which shell
> > are you using ?
> >
> > Simon.
> > _______________________________________________
> > sqlite-users mailing list
> > [hidden email]
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Simon Slavin-3


On 15 Jan 2018, at 12:30am, petern <[hidden email]> wrote:

> Shane.  That's very interesting considering the effort to make the one
> thing happen exactly once without external software dependency.

On 13 Jan 2018, at 7:33pm, Shane Dev <[hidden email]> wrote:

> I use mainly Linux (bash) and Windows (powershell) but my target platforms
> also include Android, iOS, IoT (anything that can link against the sqlite
> library).

I’ve never seen anyone compile sqlite3 (the shell tool) for iOS.  Android I have even less idea about.  Can you run command-line tools on Android ?  Has anyone compiled sqlite3 for it ?

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Brian Curley
I use Termux on Android. Very useful build of sqlite available there.

Regards.

Brian P Curley


On Jan 14, 2018 7:42 PM, "Simon Slavin" <[hidden email]> wrote:

>
>
> On 15 Jan 2018, at 12:30am, petern <[hidden email]> wrote:
>
> > Shane.  That's very interesting considering the effort to make the one
> > thing happen exactly once without external software dependency.
>
> On 13 Jan 2018, at 7:33pm, Shane Dev <[hidden email]> wrote:
>
> > I use mainly Linux (bash) and Windows (powershell) but my target
> platforms
> > also include Android, iOS, IoT (anything that can link against the sqlite
> > library).
>
> I’ve never seen anyone compile sqlite3 (the shell tool) for iOS.  Android
> I have even less idea about.  Can you run command-line tools on Android ?
> Has anyone compiled sqlite3 for it ?
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Richard Hipp-3
In reply to this post by Simon Slavin-3
On 1/14/18, Simon Slavin <[hidden email]> wrote:
>
> I’ve never seen anyone compile sqlite3 (the shell tool) for iOS.  Android I
> have even less idea about.  Can you run command-line tools on Android ?  Has
> anyone compiled sqlite3 for it ?
>

You can easily compile and run all of the SQLite command-line tools
for Android.  There are simple instructions at the bottom of the
https://www.sqlite.org/fasterthanfs.html document.

The engineers at Apple tell me this is not possible on iOS.
--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Shane Dev
In reply to this post by petern
Hi Peter,

Ideally, I would like to execute a series of "test cases" from within the
SQLite shell without dependency on an external scripting language. These
would not normally be executed by the application end user. Initially, I
planned to implement this with triggers but I see now that the results of
executing a given statement from within a trigger can be different from
executing the same statement via the SQLite shell (which I assume is
calling sqlite3_step or sqlite3_exec)

For conditional logic, case expressions are currently sufficient for my
needs. So far, I have not needed to execute a script periodically but it
might useful in the future.

Are you the developer / maintainer of the SQLite shell?

On 15 January 2018 at 01:30, petern <[hidden email]> wrote:

> Shane.  That's very interesting considering the effort to make the one
> thing happen exactly once without external software dependency.
> Does the capability to write specially named local files but not have a
> periodic loop nor network capability somehow get your application off the
> ground?
> Based on your problem statement, the user would have to initiate your
> script and know when/if it is required to be run...
>
> I had in mind adding periodic and conditional dot commands to SQLite shell
> - to simulate continuous operation of application code.  If you've figured
> out a way around needing such things to make a useful standalone SQLite
> application, I would be very interested to understand how that works.
>
> Peter
>
>
>
>
>
> On Sun, Jan 14, 2018 at 2:33 PM, Shane Dev <[hidden email]> wrote:
>
> > Hi Simon,
> >
> > I have found a way achieve this purely in the SQLite shell. The trick is
> to
> > make all rows in tcout1 SQL statements and then execute them.
> >
> > sqlite> CREATE TABLE tcout1(sql text);
> > sqlite> CREATE TABLE tcout2(sql text);
> > sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
> > '.headers off';";
> > sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
> > '.once tc'||strftime('%s','now');";
> > sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
> > 'select * from tc;';";
> > sqlite> .once tcout1.sql
> > sqlite> select * from tcout1;
> > sqlite> .read tcout1.sql
> > sqlite> select * from tcout2;
> > .headers off
> > .once tc1515968593
> > select * from tc;
> >
> >
> > On 13 January 2018 at 19:57, Simon Slavin <[hidden email]> wrote:
> >
> > > On 13 Jan 2018, at 6:48pm, Shane Dev <[hidden email]> wrote:
> > >
> > > > Is there a way to execute the contents of certain rows (the second
> row
> > in
> > > > this example) and replace it with its own result to create second
> > table /
> > > > view which could interpreted by the sqlite shell?
> > >
> > > Not inside the SQLite shell.
> > >
> > > Looks like you need to learn programming.  Or at least how to script
> your
> > > OS shell.  Which OS are you using ?  And if it’s Linux/Unix, which
> shell
> > > are you using ?
> > >
> > > Simon.
> > > _______________________________________________
> > > sqlite-users mailing list
> > > [hidden email]
> > > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> > >
> > _______________________________________________
> > sqlite-users mailing list
> > [hidden email]
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Simon Slavin-3


On 15 Jan 2018, at 10:08am, Shane Dev <[hidden email]> wrote:

> Ideally, I would like to execute a series of "test cases" from within the
> SQLite shell without dependency on an external scripting language. These
> would not normally be executed by the application end user.

Commands suited to that were added in a recent update to the shell tool.  Documentation is here:

<https://sqlite.org/cli.html>

See especially

.check
.selftest
.sha3sum
.testcase

and section 13.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Shane Dev
Hi Simon,

.selftest looks interesting

I think there is a typo in section 13 -

The .selftest command reads the rows of the selftest table in selftest.tno
order.

On 15 January 2018 at 12:06, Simon Slavin <[hidden email]> wrote:

>
>
> On 15 Jan 2018, at 10:08am, Shane Dev <[hidden email]> wrote:
>
> > Ideally, I would like to execute a series of "test cases" from within the
> > SQLite shell without dependency on an external scripting language. These
> > would not normally be executed by the application end user.
>
> Commands suited to that were added in a recent update to the shell tool.
> Documentation is here:
>
> <https://sqlite.org/cli.html>
>
> See especially
>
> .check
> .selftest
> .sha3sum
> .testcase
>
> and section 13.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can an SQL script be built from within sqlite?

Shane Dev
Sorry, false alarm, the text is correct

On 15 January 2018 at 13:36, Shane Dev <[hidden email]> wrote:

> Hi Simon,
>
> .selftest looks interesting
>
> I think there is a typo in section 13 -
>
> The .selftest command reads the rows of the selftest table in selftest.tno
> order.
>
> On 15 January 2018 at 12:06, Simon Slavin <[hidden email]> wrote:
>
>>
>>
>> On 15 Jan 2018, at 10:08am, Shane Dev <[hidden email]> wrote:
>>
>> > Ideally, I would like to execute a series of "test cases" from within
>> the
>> > SQLite shell without dependency on an external scripting language. These
>> > would not normally be executed by the application end user.
>>
>> Commands suited to that were added in a recent update to the shell tool.
>> Documentation is here:
>>
>> <https://sqlite.org/cli.html>
>>
>> See especially
>>
>> .check
>> .selftest
>> .sha3sum
>> .testcase
>>
>> and section 13.
>>
>> Simon.
>> _______________________________________________
>> sqlite-users mailing list
>> [hidden email]
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
12