parallel
[Top][All Lists]
Advanced

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

Re: Ideas for the sql command


From: Hans Schou
Subject: Re: Ideas for the sql command
Date: Thu, 9 Sep 2010 23:42:48 +0200 (CEST)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

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.

# 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

# 3. What should this do
sql 'sqlite:////tmp/file.sqlite?select%20*%20from foo;'

decode %20 and run the command.

# 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.

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

Treat "%20" as a space.

# 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

/hans
--
Horsebakken 78, DK-2400 KĂžbenhavn NV


reply via email to

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