SQLite3 has a compile option to store some (more) metadata in every query result. Normally the "sqlite3_stmt" (the structure that contains a single statement) contains 2*N columns per row: the column name and the column value. With this option the row gets 5*N columns, the extras being database name, table name and origin name. Refer to <http://www.sqlite.org/c3ref/column_database_name.html> for a longer description. My proposal is to use that option by default. Pros: - some language bindings (e.g. the Sqlite JDBC port I prepared yesterday) need that to implement some of the necessary features of the language (JDBC's ResultSetMetadata.getTableName(int) in Java's case) - very little overhead: 3*N more names in RAM (only once per query, as only one row is fetched at any time), so assuming a database with "normal" names under 20 bytes some 60 bytes per column (I guess something that can run FreeBSD, even if a small embedded, don't bother about that little RAM) - some more ports (probably) could use libsqlite3.so instead of compiling a local version themselves Cons: - unnecessary to most users except when analyzing the result of an unknown query or when implementing a database abstraction interface - libsqlite3.so increases in size by 1460 bytes Another option could be to have that as a (default on) OPTION, but given the very low overhead, I'd simply go for it personally. Fix: PORTNAME= sqlite3 PORTVERSION= 3.5.6 +PORTREVISION= 1 CATEGORIES= databases MASTER_SITES= http://www.sqlite.org/ DISTNAME= sqlite-${PORTVERSION} @@ -33,6 +34,8 @@ .include <bsd.port.pre.mk> +CFLAGS+= -DSQLITE_ENABLE_COLUMN_METADATA=1 + .if defined(WITH_DEBUG) CONFIGURE_ARGS+= --enable-debug .endif--atgd7rJiU0FVSrsQp0pDXhyMNe9iB9qH5gXuaEWLQOkDd980 Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" diff -ruN sqlite3.orig/Makefile sqlite3/Makefile --- sqlite3.orig/Makefile 2008-06-25 10:45:43.000000000 +0200 +++ sqlite3/Makefile 2008-06-26 09:50:27.000000000 +0200 @@ -7,6 +7,7 @@
Responsible Changed From-To: freebsd-ports-bugs->mnag Over to maintainer (via the GNATS Auto Assign Tool)
If ports/124905 gets committed before this PR is, its databases/sqlitejdbc/pkg-message should be deleted. In case this PR is committed as an OPTION, that databases/sqlitejdbc/pkg-message must should be changed to reflect that.
mnag 2008-10-29 16:40:09 UTC FreeBSD ports repository Modified files: databases/sqlite3 Makefile distinfo databases/sqlite3/files fts3_patch-Makefile.in patch-Makefile.in Log: - Update to 3.6.4 [1] - Add option to enable/disable column metadata [2] PR: 125004 [2] Submitted by: Lapo Luchini <lapo___lapo.it> [2] Requested by: many [1] Revision Changes Path 1.33 +7 -2 ports/databases/sqlite3/Makefile 1.23 +3 -3 ports/databases/sqlite3/distinfo 1.2 +9 -56 ports/databases/sqlite3/files/fts3_patch-Makefile.in 1.6 +12 -14 ports/databases/sqlite3/files/patch-Makefile.in _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Committed. Thanks!