-init file

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

-init file

Giuseppe Costanzi
HI all,
I am trying to open an sqlite3  shell session passing a configuration
file with the option -init  but the console it doesn't shape

my file, setconsole

headers = ON
mode    = COLUMN
timer   = ON

pep@hal9000:~/test/server$ sqlite3 -init setconsole test.db
SQLite version 3.7.13
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from halflives;
1|421|530|519|37.8|37.8|6|518|Nessuna annotazione|1
2|420|530|519|35.0|37.0|2|517|Nessuna annotazione|1
3|264|530|519|4.0|8.0|7|522|Nessuna annotazione|1
4|264|526|519|-20.0|-20.0|1|517|Nessuna annotazione|1
5|264|526|519|20.0|25.0|1|514|Nessuna annotazione|1
6|105|529|520|-20.0|-20.0|2|522|Acidificare le urine|1
7|105|529|520|4.0|8.0|2|522|Acidificare le urine|1
8|105|529|520|20.0|25.0|2|521|Acidificare le urine|1
9|418|530|520|25.0|25.0|7|522|Nessuna annotazione|1
10|418|530|520|-20.0|-20.0|6|516|Nessuna annotazione|1
11|418|530|520|4.0|8.0|7|522|Nessuna annotazione|1
12|418|530|520|20.0|25.0|3|522|Nessuna annotazione|1
13|385|526|519|37.0|37.0|15|521|L'emivita biologiaca in realta' varia
tra le 8 e le 15 ore|1
14|385|526|520|20.0|25.0|2|522|Nessuna annotazione|1
15|385|526|520|-20.0|-20.0|3|524|Nessuna annotazione|1
16|385|526|520|4.0|8.0|7|522|Nessuna annotazione|1
17|385|526|520|20.0|25.0|2|522|Nessuna annotazione|1


suggests?

p.s.
I'm on debian 6

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

Re: -init file

Simon Slavin-3

On 23 Aug 2014, at 5:28pm, Giuseppe Costanzi <[hidden email]> wrote:

> my file, setconsole
>
> headers = ON
> mode    = COLUMN
> timer   = ON

Those commands are dot commands, not proper SQLite commands.  They need to have dots in front of them.  Also, having an equals sign there is incorrect.  Those lines should look more like

.headers ON
.mode COLUMN
.timer ON

If you are in doubt about a command try typing it into the SQLite shell tool and see if it does what you want or gives you an error message.

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

Re: -init file

Giuseppe Costanzi
thanks Simon,
stupidly I have used this,

 sqlite  can  be initialized using resource files. These can be combined
       with command line arguments to set up sqlite exactly the way  you  want
       it.  Initialization proceeds as follows:

       o The defaults of


       mode            = LIST
       separator       = "|"
       main prompt     = "sqlite> "
       continue prompt = "   ...> "



 found on
http://www.linuxcommand.org/man_pages/sqlite31.html

regards
beppe

On Sat, Aug 23, 2014 at 6:35 PM, Simon Slavin <[hidden email]> wrote:

>
> On 23 Aug 2014, at 5:28pm, Giuseppe Costanzi <[hidden email]> wrote:
>
>> my file, setconsole
>>
>> headers = ON
>> mode    = COLUMN
>> timer   = ON
>
> Those commands are dot commands, not proper SQLite commands.  They need to have dots in front of them.  Also, having an equals sign there is incorrect.  Those lines should look more like
>
> .headers ON
> .mode COLUMN
> .timer ON
>
> If you are in doubt about a command try typing it into the SQLite shell tool and see if it does what you want or gives you an error message.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: -init file

Simon Slavin-3

On 23 Aug 2014, at 5:49pm, Giuseppe Costanzi <[hidden email]> wrote:

> thanks Simon,
> stupidly I have used this,

I can see how you made that mistake.  That way of showing defaults makes sense if you are reading many man pages one after another, but it's not the format that SQLite needs in the files.  I'm glad you got it working.  Post again if you think we can help.

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

Re: -init file

jose isaias cabrera
In reply to this post by Giuseppe Costanzi

"Giuseppe Costanzi" wrote...


> thanks Simon,
> stupidly I have used this,
>
> sqlite  can  be initialized using resource files. These can be combined
>       with command line arguments to set up sqlite exactly the way  you
> want
>       it.  Initialization proceeds as follows:
>
>       o The defaults of
>
>
>       mode            = LIST
>       separator       = "|"
>       main prompt     = "sqlite> "
>       continue prompt = "   ...> "
>
>
>
> found on
> http://www.linuxcommand.org/man_pages/sqlite31.html

That man page is a little outdated.  It used SQLite version 3.0.8 and its
date at the bottom is
Mon Apr 15 23:49:17 2002                  SQLITE(1)

>
> regards
> beppe
>
> On Sat, Aug 23, 2014 at 6:35 PM, Simon Slavin <[hidden email]>
> wrote:
>>
>> On 23 Aug 2014, at 5:28pm, Giuseppe Costanzi <[hidden email]>
>> wrote:
>>
>>> my file, setconsole
>>>
>>> headers = ON
>>> mode    = COLUMN
>>> timer   = ON
>>
>> Those commands are dot commands, not proper SQLite commands.  They need
>> to have dots in front of them.  Also, having an equals sign there is
>> incorrect.  Those lines should look more like
>>
>> .headers ON
>> .mode COLUMN
>> .timer ON
>>
>> If you are in doubt about a command try typing it into the SQLite shell
>> tool and see if it does what you want or gives you an error message.
>>
>> Simon.
>> _______________________________________________
>> sqlite-users mailing list
>> [hidden email]
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 

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

Re: -init file

Keith Medcalf
>> sqlite  can  be initialized using resource files. These can be combined
>>       with command line arguments to set up sqlite exactly the way  you
>> want
>>       it.  Initialization proceeds as follows:
>>
>>       o The defaults of
>>
>>
>>       mode            = LIST
>>       separator       = "|"
>>       main prompt     = "sqlite> "
>>       continue prompt = "   ...> "
>>
>>
>>
>> found on
>> http://www.linuxcommand.org/man_pages/sqlite31.html
>
>That man page is a little outdated.  It used SQLite version 3.0.8 and its
>date at the bottom is
>Mon Apr 15 23:49:17 2002                  SQLITE(1)

Nonetheless, in no less than two places in the man page is it stated that the init file should contain dot-commands which will be processed by the shell after its standard initialization and before processing commands supplied via whatever stdin stream content it would, but for the init commands, process.

While the specifics of the dot-commands themselves may have changed, or there may be new ones or deprecated ones removed depending on version, the description of the processing is still accurate.




_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users