[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pq 56fde7b255 53/63: Improve docstrings.
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pq 56fde7b255 53/63: Improve docstrings. |
Date: |
Mon, 14 Feb 2022 23:24:27 -0500 (EST) |
branch: externals/pq
commit 56fde7b255c827b34f9d66a723a1de497fdbb548
Author: Andreas Seltenreich <seltenreich@gmx.de>
Commit: Andreas Seltenreich <seltenreich@gmx.de>
Improve docstrings.
---
pq.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 61 insertions(+), 5 deletions(-)
diff --git a/pq.c b/pq.c
index a7faf37845..a55779961a 100644
--- a/pq.c
+++ b/pq.c
@@ -310,25 +310,81 @@ emacs_module_init (struct emacs_runtime *ert)
bind_function (env, lsym, \
env->make_function (env, amin, amax, csym, doc, data))
DEFUN("pq:connectdb", Fpq_connectdb, 0, 1,
- "Connect to PostgreSQL database described by CONNSTR.",
+ "Connect to a PostgreSQL database described by CONNINFO.\n"
+ "\n"
+ "CONNINFO is a Connection String as defined in the PostgreSQL manual.\n"
+ "E.g., \"host=localhost port=5432 dbname=mydb connect_timeout=10\"\n"
+ "\n"
+ "Return a user-ptr representing the libpq connection.\n"
+ "Error if connection cannot established.\n"
+ "\n\(fn CONNINFO)",
NULL);
+#define stringify(s) #s
+
DEFUN("pq:query", Fpq_query, 2, 2+MAX_PQ_PARAMS,
- "Execute QUERY on CONNECTION with optional PARAMETERS.",
+ "Execute COMMAND on CONN with optional PARAMETERS.\n"
+ "\n"
+ "Run an SQL command on a connection obtained by `pq:connectdb'.\n"
+ "If PARAMETERS are used, you can reference them in COMMAND using\n"
+ "$1, $2, ..., $12.\n"
+ "\n"
+ "Return the list of rows returned by the last statement in COMMAND.\n"
+ "Rows are returned as atomic values if the statement yields a single\n"
+ "column, or a vector of values if it yields more than one column.\n"
+ "\n"
+ "SQL values are turned into Lisp strings except for the following:\n"
+ "\n"
+ " NULL: always returned as nil\n"
+ " true/false: t/nil\n"
+ " integer: integer or float, depending on size\n"
+ " float, numeric: float\n"
+ "\n"
+ "While these conversions are convenient, they may loose precision.\n"
+ "If you need the full precision of big integer values or need to be\n"
+ "able to discern between NULL and false, simply cast these to text\n"
+ "in your query.\n"
+ "\n"
+ "Error on SQL errors. Diagnostic information such as warnings is\n"
+ "emitted using `message'.\n"
+ "\n\(fn CONN COMMAND &rest PARAMETERS)"
+ ,
NULL);
DEFUN("pq:escapeLiteral", Fpq_escape, 2, 2,
- "Perform literal value quoting on STRING for CONN.",
+ "Perform literal value quoting on STRING for CONN.\n"
+ "\n"
+ "Return a string for use within an SQL command. This is useful\n"
+ "when inserting data values as literal constants in SQL commands.\n"
+ "Certain characters (such as quotes and backslashes) must be\n"
+ "escaped to prevent them from being interpreted specially by the\n"
+ "SQL parser.\n"
+ "\n"
+ "Note that it is not necessary nor correct to do escaping when a\n"
+ "data value is passed as a separate parameter in `pq:query'.\n"
+ "\n\(fn CONN STRING)",
PQescapeLiteral);
DEFUN("pq:escapeIdentifier", Fpq_escape, 2, 2,
- "Perform identifier value quoting on STRING for CONN.",
+ "Perform identifier value quoting on STRING for CONN.\n"
+ "\n"
+ "Return a string for use as an SQL identifier, such as a table,\n"
+ "column, or function name. This is useful when a user-supplied\n"
+ "identifier might contain special characters that would otherwise\n"
+ "not be interpreted as part of the identifier by the SQL parser,\n"
+ "or when the identifier might contain upper case characters whose\n"
+ "case should be preserved.\n"
+ "\n\(fn CONN STRING)",
PQescapeIdentifier);
DEFUN("pq:reset", Fpq_reset, 1, 1,
- "Resets the communication channel to the server behind CONN.",
+ "Resets the communication channel to the server behind CONN.\n"
+ "\n"
+ "Return t if connection is ok again.\n"
+ "\n\(fn CONN)",
NULL);
+#undef stringify
#undef DEFUN
provide(env, "pq");
- [elpa] externals/pq 2c03e4aba4 42/63: Make garbage-collection test more robust., (continued)
- [elpa] externals/pq 2c03e4aba4 42/63: Make garbage-collection test more robust., ELPA Syncer, 2022/02/14
- [elpa] externals/pq dc688341b0 35/63: test: Check more raised errors in different parts of the code., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 33e626d5b8 11/63: README: It's no longer quick and dirty., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 45a732a4c2 31/63: Add test for signal error, ELPA Syncer, 2022/02/14
- [elpa] externals/pq 6ab076af29 26/63: Fix memory leak., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 191b842a56 21/63: Add missing static declarations., ELPA Syncer, 2022/02/14
- [elpa] externals/pq f896dabb85 22/63: Install notice receiver while fetching results as well., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 8964028f11 25/63: Coerce non-string query parameters into strings., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 83157bd41e 32/63: Cleanup session initialization., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 3026279578 48/63: Use pg_config with --includedir instead of --pkgincludedir., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 56fde7b255 53/63: Improve docstrings.,
ELPA Syncer <=
- [elpa] externals/pq c9df58b1ac 49/63: Always look up t and nil instead of caching them., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 04c91e8374 63/63: add pq.el and move pq.c -> pq-core.c, ELPA Syncer, 2022/02/14
- [elpa] externals/pq 8cc484c68b 62/63: README: Fix typos., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 272b18abec 43/63: Makefile: Add dependency to check target., ELPA Syncer, 2022/02/14
- [elpa] externals/pq bec131bfae 61/63: README: Elaborate on usage., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 8044537122 23/63: Add testcase that provokes a NOTIFY., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 5566645359 56/63: Fix ERROR-DATA not being a list., ELPA Syncer, 2022/02/14
- [elpa] externals/pq d4c53f6461 55/63: Update README., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 0501c66e6a 51/63: Add testcase for crash reported by "717g301github"., ELPA Syncer, 2022/02/14
- [elpa] externals/pq bc939f732e 30/63: Setup emacs ert tests, ELPA Syncer, 2022/02/14