Re: Terms advice.

Поиск
Список
Период
Сортировка
От Dmitriy Igrishin
Тема Re: Terms advice.
Дата
Msg-id AANLkTik8dmxah5oy2FmA+CJQLkPD86tiUKyziY9aF04E@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Terms advice.  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-general
Hey Craig,

I know about libpqxx. But I like to implement my library
just for fun :-).

The one goal of my library is to support all features of libpq.
So, I don't intent to implement the protocol from scratch
and use libpq as basis.

Another goal of my library is to be very clean and consistent
in terms. For example, I want avoid the situations like this.
consider PQsendQuery function of libpq:

int PQsendQuery(PGconn *conn, const char *command);

Description: "Submits a command to the server ... "

Because I meticulous, I don't clearly understand, why
function called PQsendQuery rather than PQsendCommand?
There is no consistence between name of function and name
of its second argument, and furthermore according to
http://www.postgresql.org/docs/9.0/static/sql-commands.html
users operates with commands (not queries) :-)
But according to SQL (structured query language) users
operates with queries :-)

Next, consider
http://www.postgresql.org/docs/9.0/static/libpq-exec.html#LIBPQ-EXEC-SELECT-INFO

"These functions are used to extract information from a PGresult
object that represents a successful query result (that is, one that
has status PGRES_TUPLES_OK)... ". Well, here "query" used as
a command which returns data (tuples). But this is inconsistent
e.g., with mentioned PQsendQuery, because in this case "query"
can be a "command" which returns no data (and in terms of SQL
it is correct).

Of course, this may seem petty and not worthy of such attention.
But I believe that extra correctness helps better understand any
library or program.

BTW. "query" and "command" are synonyms, as I mentioned
above. :-)

2010/11/27 Craig Ringer <craig@postnewspapers.com.au>
On 11/26/2010 09:37 PM, Dmitriy Igrishin wrote:
Hey all,

I am working on C++ library to work with PostgreSQL.

Are you aware of libpqxx ?

Is your intent to implement the protocol from scratch in c++ rather than wrap libpq? If so, why?

--
Craig Ringer



--
// Dmitriy.


В списке pgsql-general по дате отправления:

Предыдущее
От: c k
Дата:
Сообщение: Re: plpyhton
Следующее
От: Emanuel Calvo Franco
Дата:
Сообщение: array_agg + limit