Re: [sqlite] sql/tcl script

2012-01-16 Thread Simon Slavin

On 16 Jan 2012, at 8:11pm, Bill McCormick wrote:

> I was sort of hoping it might be narrowed down to one of the documents on 
> this page:
> 
> http://www.sqlite.org/docs.html
> 
> Typing "script" and "command line" in the search box didn't help me find what 
> I was looking for either.

Ah, I totally understand that problem.  It's called 'shell tool'.  Googling 
'sqlite shell' should do it.

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


Re: [sqlite] sql/tcl script

2012-01-16 Thread Stephan Beal
On Mon, Jan 16, 2012 at 9:21 PM, Tim Streater  wrote:

> I'm using the PDO interface from PHP for SQLite3 with no problems. What
> are you referring to?
>

Sorry for the confusion - i meant that those are languages which _do_ have
sqlite3 bindings (but my wording implied the opposite).

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sql/tcl script

2012-01-16 Thread Tim Streater
On 16 Jan 2012 at 18:15, Stephan Beal  wrote: 

> On Mon, Jan 16, 2012 at 7:12 PM, Bill McCormick wrote:
>
>> Is tcl the only scripting interface for SQLite? I'm just wondering what
>> the options are.

> There are few scripting languages which don't have an sqlite3 binding. Just
> to name a few:
>
> - Perl
> - PHP

I'm using the PDO interface from PHP for SQLite3 with no problems. What are you 
referring to?

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


Re: [sqlite] sql/tcl script

2012-01-16 Thread Bill McCormick

Simon Slavin wrote, On 1/16/2012 1:45 PM:

On 16 Jan 2012, at 7:34pm, Bill McCormick wrote:


Looks like pipes work as well (cat yoursql.sql|sqlite3  yourdb.db3).

Also, can I safely delete the database file (yourdb.db3, using your example) if 
I just want to start again? It appears that I can.

Not while an app has it open, but if none of the apps are running then yes: a 
database file is just a single file, with no funny tricks about it, and you can 
move, rename or delete it.


Where are these little nuggets documented?

www.sqlite.org

I was sort of hoping it might be narrowed down to one of the documents 
on this page:


http://www.sqlite.org/docs.html

Typing "script" and "command line" in the search box didn't help me find 
what I was looking for either. Worse, it lead me down the Tcl path, 
thinking that Tcl would be the only way to do this. I didn't find 
anything in the FAQ's that answered my question either.


I guess it's just a matter of coming up to speed.

Thanks!!


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


Re: [sqlite] sql/tcl script

2012-01-16 Thread Oliver Peters

Am 16.01.2012 20:34, schrieb Bill McCormick:

Oliver Peters wrote, On 1/16/2012 1:02 PM:

Am 16.01.2012 19:59, schrieb Bill McCormick:

James Pearson wrote, On 1/16/2012 12:28 PM:

If it's just for setting up databases, tables, etc, why not just use a
sql script?

Throw all your database object creation sql into a file and then
execute that file from within sqlite using the ".read FILE" command.


I think this is what I'm looking for. Is there some way to have sqlite3
execute a .read FILE command from a bash prompt?




sqlite3 yourdb.db3 < yoursql.sql


Even better.

Looks like pipes work as well (cat yoursql.sql|sqlite3 yourdb.db3).



http://www.linuxwiki.de/UselessUseOfCat



Also, can I safely delete the database file (yourdb.db3, using your
example) if I just want to start again? It appears that I can.


what do you mean by "safely delete"?



Where are these little nuggets documented?


sqlite3 --help

and

sqlite3
.h

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


Re: [sqlite] sql/tcl script

2012-01-16 Thread Simon Slavin

On 16 Jan 2012, at 7:34pm, Bill McCormick wrote:

> Looks like pipes work as well (cat yoursql.sql|sqlite3  yourdb.db3).
> 
> Also, can I safely delete the database file (yourdb.db3, using your example) 
> if I just want to start again? It appears that I can.

Not while an app has it open, but if none of the apps are running then yes: a 
database file is just a single file, with no funny tricks about it, and you can 
move, rename or delete it.

> Where are these little nuggets documented?

www.sqlite.org

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


Re: [sqlite] sql/tcl script

2012-01-16 Thread Bill McCormick

Oliver Peters wrote, On 1/16/2012 1:02 PM:

Am 16.01.2012 19:59, schrieb Bill McCormick:

James Pearson wrote, On 1/16/2012 12:28 PM:

If it's just for setting up databases, tables, etc, why not just use a
sql script?

Throw all your database object creation sql into a file and then
execute that file from within sqlite using the ".read FILE" command.


I think this is what I'm looking for. Is there some way to have sqlite3
execute a .read FILE command from a bash prompt?




sqlite3  yourdb.db3 < yoursql.sql


Even better.

Looks like pipes work as well (cat yoursql.sql|sqlite3  yourdb.db3).

Also, can I safely delete the database file (yourdb.db3, using your 
example) if I just want to start again? It appears that I can.


Where are these little nuggets documented?

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


Re: [sqlite] sql/tcl script

2012-01-16 Thread Stephan Beal
On Mon, Jan 16, 2012 at 8:02 PM, Bill McCormick wrote:

> I assume that you are *NOT* naming the few that don't, rather these
> scripting languages *DO* have sqlite3 binding support.


Yes, sorry - a bad choice of wording on my part. :/

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sql/tcl script

2012-01-16 Thread Oliver Peters

Am 16.01.2012 19:59, schrieb Bill McCormick:

James Pearson wrote, On 1/16/2012 12:28 PM:

If it's just for setting up databases, tables, etc, why not just use a
sql script?

Throw all your database object creation sql into a file and then
execute that file from within sqlite using the ".read FILE" command.


I think this is what I'm looking for. Is there some way to have sqlite3
execute a .read FILE command from a bash prompt?




sqlite3  yourdb.db3 < yoursql.sql

Oliver




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



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


Re: [sqlite] sql/tcl script

2012-01-16 Thread Bill McCormick

Stephan Beal wrote, On 1/16/2012 12:15 PM:

On Mon, Jan 16, 2012 at 7:12 PM, Bill McCormickwrote:


Is tcl the only scripting interface for SQLite? I'm just wondering what
the options are.



There are few scripting languages which don't have an sqlite3 binding. Just
to name a few:

- Perl
- PHP
- JavaScript (v8 and SpiderMonkey engines)
- Python
...


I assume that you are *NOT* naming the few that don't, rather these 
scripting languages *DO* have sqlite3 binding support.

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


Re: [sqlite] sql/tcl script

2012-01-16 Thread Simon Slavin

On 16 Jan 2012, at 6:59pm, Bill McCormick wrote:

> James Pearson wrote, On 1/16/2012 12:28 PM:
>> If it's just for setting up databases, tables, etc, why not just use a sql 
>> script?
>> 
>> Throw all your database object creation sql into a file and then execute 
>> that file from within sqlite using the ".read FILE" command.
>> 
> I think this is what I'm looking for.  Is there some way to have sqlite3 
> execute a .read FILE command from a bash prompt?

Sure.  Use bash scripting.  Or script any other unix shell to run the 'sqlite3' 
command-line tool.  Command options documented here:



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


Re: [sqlite] sql/tcl script

2012-01-16 Thread Bill McCormick

James Pearson wrote, On 1/16/2012 12:28 PM:
If it's just for setting up databases, tables, etc, why not just use a 
sql script?


Throw all your database object creation sql into a file and then 
execute that file from within sqlite using the ".read FILE" command.


I think this is what I'm looking for.  Is there some way to have sqlite3 
execute a .read FILE command from a bash prompt?



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


Re: [sqlite] sql/tcl script

2012-01-16 Thread James Pearson
If it's just for setting up databases, tables, etc, why not just use a 
sql script?


Throw all your database object creation sql into a file and then execute 
that file from within sqlite using the ".read FILE" command.




On 16 Jan 2012, at 11:23, John Elrick wrote:


Ruby also.

On Mon, Jan 16, 2012 at 1:15 PM, Stephan Beal  
wrote:


On Mon, Jan 16, 2012 at 7:12 PM, Bill McCormick 


Re: [sqlite] sql/tcl script

2012-01-16 Thread John Elrick
Ruby also.

On Mon, Jan 16, 2012 at 1:15 PM, Stephan Beal  wrote:

> On Mon, Jan 16, 2012 at 7:12 PM, Bill McCormick  >wrote:
>
> > Is tcl the only scripting interface for SQLite? I'm just wondering what
> > the options are.
> >
>
>
> There are few scripting languages which don't have an sqlite3 binding. Just
> to name a few:
>
> - Perl
> - PHP
> - JavaScript (v8 and SpiderMonkey engines)
> - Python
> ...
>
>
> --
> - stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
John Elrick
Fenestra Technologies
540-868-1377
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sql/tcl script

2012-01-16 Thread Stephan Beal
On Mon, Jan 16, 2012 at 7:12 PM, Bill McCormick wrote:

> Is tcl the only scripting interface for SQLite? I'm just wondering what
> the options are.
>


There are few scripting languages which don't have an sqlite3 binding. Just
to name a few:

- Perl
- PHP
- JavaScript (v8 and SpiderMonkey engines)
- Python
...


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sql/tcl script

2012-01-16 Thread Bill McCormick
Is tcl the only scripting interface for SQLite? I'm just wondering what 
the options are.


I'm trying to write a script to setup my database on new systems (create 
the db, add tables, etc.), but I don't have much experience using Tcl.


My fist attempt is not going so well and I'm not finding help in any of 
the docs online. If you of you experts could kindly provide 1) where I 
should be looking for answers for this sort of thing and 2) and example 
Tcl script, I would be eternally grateful.




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