parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ideas for the sql command


From: Ole Tange
Subject: Re: Ideas for the sql command
Date: Fri, 10 Sep 2010 00:22:16 +0200

On Thu, Sep 9, 2010 at 11:42 PM, Hans Schou <chlor@schou.dk> wrote:
> On Thu, 9 Sep 2010, Ole Tange wrote:
>
>> The DBURL is not strictly defined yet, and I need some input on what
>> would be a good behaviour.
>>
>> What should the following commands do to cause the least surprise for the
>> user:
>>
>> # 1. Should this run 'select * from foo' on the sqlite base
>> /tmp/file.sqlite
>> sql 'sqlite:////tmp/file.sqlite?select * from foo;'
>
> sqlite accept ';' when it gets on single command:
>  echo "SELECT * FROM foo;" | sqlite test
> so this cmd should just run "SELECT * FROM foo" as expected.

Implemented in git-version.

>> # 2. Should this run 'select * from foo' on the sqlite base
>> /tmp/file.sqlite
>> sql 'sqlite:////tmp/file.sqlite?select%20*%20from%20foo;'
>
> The normal behavior for an URI is to decode %-encoding. 'sql' should do so:
> http://tools.ietf.org/html/rfc3986#section-2.1

Implemented in git-version.

>> # 3. What should this do
>> sql 'sqlite:////tmp/file.sqlite?select%20*%20from foo;'
>
> decode %20 and run the command.

Implemented in git-version.

>> # 4. What should this do
>> sql "sqlite:////tmp/file.sqlite?select * from foo where url like 'bar%';"
>
> As "%';" can not be decoded, it should either gives an error, or be polite
> and guess that the user ment it literally.

Current git-version leaves the % if it cannot be decoded.

>> # 5. What should this do
>> sql "sqlite:////tmp/file.sqlite?select * from foo where url like
>> 'bar%20';"
>
> Treat "%20" as a space.

Implemented in git-version.

>> # 6. Should this return "Incomplete SQL: select * from foo"
>> # Or should it add the missing ;
>> sql sqlite:////tmp/file.sqlite 'select * from foo'
>
> Incomplete SQL: select * from foo

Implemented in git-version.

/Ole



reply via email to

[Prev in Thread] Current Thread [Next in Thread]