From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Romel Sandoval Newsgroups: gmane.lisp.guile.user Subject: Re: Data Dictionary and Configuration Files with Guile Scheme Date: Fri, 20 Aug 2010 09:10:14 -0500 Message-ID: <1282313414.2470.1.camel@romel-compaq> References: <1281028544.2624.38.camel@romel-compaq> <87zkwj9407.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1282313462 30832 80.91.229.12 (20 Aug 2010 14:11:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Aug 2010 14:11:02 +0000 (UTC) Cc: guile-user@gnu.org To: Thien-Thi Nguyen Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Aug 20 16:11:00 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OmSJ5-0004KH-2g for guile-user@m.gmane.org; Fri, 20 Aug 2010 16:10:59 +0200 Original-Received: from localhost ([127.0.0.1]:44996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OmSIz-000529-6S for guile-user@m.gmane.org; Fri, 20 Aug 2010 10:10:49 -0400 Original-Received: from [140.186.70.92] (port=52353 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OmSIf-0004wC-AC for guile-user@gnu.org; Fri, 20 Aug 2010 10:10:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OmSIW-00087i-IJ for guile-user@gnu.org; Fri, 20 Aug 2010 10:10:21 -0400 Original-Received: from karen.lavabit.com ([72.249.41.33]:60289) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmSIW-00086c-Dw for guile-user@gnu.org; Fri, 20 Aug 2010 10:10:20 -0400 Original-Received: from b.earth.lavabit.com (b.earth.lavabit.com [192.168.111.11]) by karen.lavabit.com (Postfix) with ESMTP id 30A0C11BB54; Fri, 20 Aug 2010 09:10:17 -0500 (CDT) Original-Received: from 148.209.128.70 (dsl-201-155-81-234-sta.prod-empresarial.com.mx [201.155.81.234]) by lavabit.com with ESMTP id A3MP6FBMTAB7; Fri, 20 Aug 2010 09:10:17 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=dobFzcnuc7pIN/lXwbTRBBqvadVqTl3p8dgfadOE+pMVqtXZy4mLH91y5Ts3Crky4SWBAR1G2TpjiwtPkTEuKRohp/EFgfCP31LQP1RJusJIjaxAtp1teGE7Hzb+SO7ulzcFPbbq+0xEGKUNyh7zj5C2oe7gA1l7juzYKpE7/6I=; h=Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date:Message-ID:Mime-Version:X-Mailer:Content-Transfer-Encoding; In-Reply-To: <87zkwj9407.fsf@ambire.localdomain> X-Mailer: Evolution 2.28.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8088 Archived-At: Thanks Thien-Thi that's exactly what I was trying to achieve. El mi=C3=A9, 18-08-2010 a las 20:20 +0200, Thien-Thi Nguyen escribi=C3=B3= : > () Romel Sandoval > () Thu, 05 Aug 2010 12:15:44 -0500 >=20 > What do you think? >=20 > I use Guile-PG (several modules) and a homegrown metainfo table > accessible via =E2=80=98(ttn-do zzz various-db) personal-pgtable-defs=E2= =80=99 et al: > http://www.gnuvola.org/software/ttn-do/ttn-do.html.gz#zzz-various_002dd= b >=20 > Here is ~/.pgtable-defs, omitting some parts: >=20 > ;;; ~/.pgtable-defs --- database descriptions -*- scheme -*- > =20 > ;; Keyword Expansions > ;; ------------------ > =20 > ((#:pk "PRIMARY KEY") > (#:u "UNIQUE") > (#:nn "NOT NULL") > (#:mf "MATCH FULL") > (#:dc "ON DELETE CASCADE") > (#:uc "ON UPDATE CASCADE") > (#:r "REFERENCES") > (#:tz "WITH TIME ZONE")) > =20 > ;; Database Table Definitions > ;; -------------------------- > ;; > ;; ((DB-1 (TABLE DEF ...) (TABLE DEF ...) ...) > ;; (DB-2 (TABLE DEF ...) (TABLE DEF ...) ...) ...) > ;; > ;; Some day `infer-defs' will be able to round-trip these... > =20 > (("ttn" > =20 > ("sw_maint" > (v bool #:nn) > (url text #:nn) > (mon text #:nn) > (name text #:pk) > (orig text) > (mtim timestamp[]))) ; 0: mon > =20 > ("gnuvola" > =20 > ("updbad" > (time timestamp #:pk) > (cause text) > (errmsg text)) > =20 > ("updok" > (time timestamp #:pk) > (wrote int4) > (read int4) > (rate float4) > (total int4) > (speedup float4)) > =20 > ("updfiles" > (file text) > (move char) > (time timestamp #:r "updok" #:dc #:uc)))) > =20 > ;;; ~/.pgtable-defs ends here >=20 > This file consists of two forms. The first is (hopefully) > self-explanatory. The second describes two databases: >=20 > db tables > ------- ----------------------- > ttn sw_maint > gnuvola updbad, updok, updfiles >=20 > Each table's columns are further described in a way that really ought t= o > be queryable from the backend, so that is a Code Enhancement Opportunit= y > for the Guile-PG reflection module alluded to by the "Some day" comment= . >=20 > Although i think SQL is ugly (and thus concur in jest, i believe, > with Andy Wingo's admonition :-), Guile-PG makes it livable. E.g.: > http://www.gnuvola.org/software/guile-pg/qcons-notes.txt >=20 > So, to answer your question: yes, sexps work fine as a Data Dictionary.