From marijnh at gmail.com Tue Jan 2 17:15:51 2007 From: marijnh at gmail.com (Marijn Haverbeke) Date: Tue, 2 Jan 2007 18:15:51 +0100 Subject: [postmodern-devel] postmodern, pg, cl-rdbms In-Reply-To: References: Message-ID: Hello Attila, Finally getting around to looking at cl-rdbms, I found it to be very well thought out -- its syntax probably supports more different constructs than s-sql does at this point. Its syntax is probably also quite a bit more thought out. If, a month ago, you had had some minimal documentation, I'd probably have realized this earlier, heh. Also, one of the reasons I stuck to Postgres-specificness is that I don't know enough about other databases, and do not have the time, to write stuff in a multi-backend way. Maybe the cl-rdbms code can help there (though it's also still only tested on pg). So now the burning question presents itself -- do we merge? I haven't played with cl-rdbms enough to know how much I like it. Its DAO (records) approach seems more primitive than Postmodern's. How stable are the various parts of the library? Is anybody planning to put some effort into documentation anytime soon? I guess what it boils down to is: A) I'm not in the possession of a lot of time for merging these libraries myself at the moment, but f you or someone else would be interested in putting work into this I'd be happy to cooperate. B) I'm rather proud of some of the stuff I did in the Postmodern code, and of the docs, so I want to at least have some influence in the merging process. But of course, C) It's no good to have multiple similar libraries, we should all join together and make a solid CLSQL-replacement. So, let me know what you think. Regards, Marijn -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.lendvai at gmail.com Tue Jan 2 18:16:46 2007 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Tue, 2 Jan 2007 19:16:46 +0100 Subject: [postmodern-devel] postmodern, pg, cl-rdbms In-Reply-To: References: Message-ID: > So, let me know what you think. sorry for being quiet, i promise to write a more detailed answer later. until then a few quick toughts: - i didn't know it's you Marijn (hint for the website :) - cl-rdbms is only 7 weeks old... :) - unfortunately i doubt there will be any docs for cl-rdbms. we belive that the code must be written so that it's self documenting (by using long names without abbreviations, factor out everything feasible, etc) with an easy-to-play-with test suite that covers/demonstrates all the features. - the multi backend stuff is only a theoretical framework with a single pg backend for now. it's only based on our previous programming experience, so until the second backend is made... - after a first impression i like many things in postmodern - i'm also open for merging and in no way want to assimilate postmodern without you being involved - not too much time here either (the rewrite of clsql was a sacrifice itself that didn't worth it in the short term. let's hope there'll be a long-term... :) - the ucw ajax branch was an experiment of mine and i'm not especially proud of the internal code quality. (ucw is basically a repo of random web-related features with more connections between them than necessary, but hopefully Drew's cleanup will handle that) happy new year, i'll be back later -- - attila "- The truth is that I've been too considerate, and so became unintentionally cruel... - I understand. - No, you don't understand! We don't speak the same language!" (Ingmar Bergman - Smultronst?llet) From gnp at freemail.gr Sun Jan 21 09:45:23 2007 From: gnp at freemail.gr (Giorgos Pontikakis) Date: Sun, 21 Jan 2007 11:45:23 +0200 Subject: [postmodern-devel] ~ infix operator Message-ID: <200701211145.23748.gnp@freemail.gr> Hi, First, I think this is an very good library and I have to thank you for releasing it. The documentation is exceptionally good, congratulations for your effort. Second, I noticed that the ~ infix operator from PostgreSQL for regular expressions is not included in the def-infix-ops (file s-sql.lisp). I suppose that this is because it conflicts with the bitwise NOT operator with the same name, which is defined after a few lines. For the time being, I just changed the bitwise NOT to :~~ and added the :~ to the def-infix-ops forms. Is this something you overlooked or is there another way to access regular expressions functionality? Third, since I see you care about the documentation, I think you should point out in the documentation that the deftable form must define the table columns in the same order with its PostgreSQL counterpart, since you use the * abbreviation in the get-dao select statement. Otherwise, the get-dao does not work. Finally, is there a way to access the constraints of an SQL table from the Lisp side? I have not managed to find anything related yet. That's all for the time being. Once more, thank you very much for the library. Best regards, Giorgos Pontikakis From marijnh at gmail.com Mon Jan 22 08:00:53 2007 From: marijnh at gmail.com (Marijn Haverbeke) Date: Mon, 22 Jan 2007 09:00:53 +0100 Subject: [postmodern-devel] ~ infix operator In-Reply-To: <200701211145.23748.gnp@freemail.gr> References: <200701211145.23748.gnp@freemail.gr> Message-ID: Hello, For the time being, I just changed the bitwise NOT to :~~ and added > the :~ to the def-infix-ops forms. Is this something you overlooked > or is there another way to access regular expressions functionality? Good question. I never really use the regexp functionality, so I didn't really think about this. It looks like regular expression matching always takes two arguments, while bitwise NOT only takes one, so I think a good solution would be to make that operator behave like minus and allow both binary infix and unary prefix application. I'll add the other regexp operators (~*, !~, and !~*) too, while I'm at it. Third, since I see you care about the documentation, I think you > should point out in the documentation that the deftable form must > define the table columns in the same order with its PostgreSQL > counterpart, since you use the * abbreviation in the get-dao select > statement. Otherwise, the get-dao does not work. You have a point there. I assumed people would create their tables from the lisp definition, in which case everything works fine. This will probably also be an issue when you end up adding or dropping rows in tables -- the best solution is probably to fix dao-loading so that it takes column names into account. This might make it a bit slower, but right now it's just confusing. I'll try to fix this this week. Finally, is there a way to access the constraints of an SQL table from > the Lisp side? I have not managed to find anything related yet. No, though this is something that I definitely want to add. Unfortunately I'm a bit tied up with other work at the moment, so it might take a while. If you feel up to it, a patch would be welcome. Regards, Marijn -------------- next part -------------- An HTML attachment was scrubbed... URL: From marijnh at gmail.com Wed Jan 24 07:44:48 2007 From: marijnh at gmail.com (Marijn Haverbeke) Date: Wed, 24 Jan 2007 08:44:48 +0100 Subject: [postmodern-devel] ~ infix operator In-Reply-To: References: <200701211145.23748.gnp@freemail.gr> Message-ID: I released verion .21, which should solve your first two problems. Haven't quite decided on the syntax for foreign keys, maybe :create-table can look like defclass too: (:create-table 'my-table ((slot-a :type integer :foreign-key (my-other-table id) :default 55) (slot-b :type (or null (string 24))) (:primary-key slot-a) (:foreign-key (slot-a slot-b) (yet-another-table a b) (:unique-index slot-b)) ;; Not really part of CREATE TABLE, but hey, why not? Then deftable doesn't have to do as much transforming on the definition and can remain simple. Also, I'm not sure how to handle the creation of a set of tables that contain foreign keys -- since they have to be created in the right order. Altering them is even more tricky. Maybe I'll default to deferrable foreign keys, and turn on deferring when messing with the table scheme. Let me know what you think. Marijn -------------- next part -------------- An HTML attachment was scrubbed... URL: From marijnh at gmail.com Sat Jan 27 11:44:51 2007 From: marijnh at gmail.com (Marijn Haverbeke) Date: Sat, 27 Jan 2007 12:44:51 +0100 Subject: [postmodern-devel] Release 0.22 Message-ID: Hello list, Version .22 of Postmodern has been released, which adds constraints (uniqueness, checks, foreign keys) and default values to :create-table's syntax (not backwards compatible), and changes the approach to transactions somewhat (also a small syntax change). Marijn -------------- next part -------------- An HTML attachment was scrubbed... URL: From gnp at freemail.gr Sat Jan 27 16:33:49 2007 From: gnp at freemail.gr (Giorgos Pontikakis) Date: Sat, 27 Jan 2007 18:33:49 +0200 Subject: [postmodern-devel] Re: postmodern-devel Digest, Vol 2, Issue 4 In-Reply-To: <20070124170211.E9BBE59085@common-lisp.net> References: <20070124170211.E9BBE59085@common-lisp.net> Message-ID: <200701271833.49712.gnp@freemail.gr> Hello Marijn, Sorry for the belated response, I had been busy through the week and I checked my email just today | I released verion .21, which should solve your first two problems. Great, I will try the new version. Thanks | Haven't quite decided on the syntax for foreign keys, maybe | :create-table can look like defclass too: | | (:create-table 'my-table | ((slot-a :type integer :foreign-key (my-other-table id) :default | 55) (slot-b :type (or null (string 24))) | (:primary-key slot-a) | (:foreign-key (slot-a slot-b) (yet-another-table a b) | (:unique-index slot-b)) ;; Not really part of CREATE TABLE, but | hey, why not? | Then deftable doesn't have to do as much transforming on the | definition and can remain simple. | | Also, I'm not sure how to handle the creation of a set of tables | that contain foreign keys -- since they have to be created in the | right order. Altering them is even more tricky. Maybe I'll default | to deferrable foreign keys, and turn on deferring when messing with | the table scheme. | | Let me know what you think. | Well, I don't know, sorry. I am an amateur and my real job does not involve computers. I have no experience in sql. I just noticed that you released 0.22. I'll try to use it and I'll report if I have anything constructive to say. Thanks again -- Giorgos From houfen at gmail.com Sun Jan 28 04:23:24 2007 From: houfen at gmail.com (Feng Hou) Date: Sat, 27 Jan 2007 23:23:24 -0500 Subject: [postmodern-devel] 0.22 regression? Message-ID: <9888ad320701272023i75fde6ffl205acae9a89c5099@mail.gmail.com> CL-USER> (deftable test-data () ((field1 :type integer) (field2 :type (or string db-null)) (field3 :type (numeric 10 3))) (:indices field1 field3)) CL-USER> (create-table 'test-data) Database error 42601: syntax error at end of input Query: CREATE TABLE test_data (field1 INTEGER NOT NULL, field2 TEXT [Condition of type DATABASE-ERROR] 3: (CL-POSTGRES:EXEC-QUERY # "CREATE TABLE test_data (field1 INTEGER NOT NULL, field2 TEXT" CL-POSTGRES:IGNORE-ROW-READER) Locals: CL-POSTGRES::CONNECTION = # CL-POSTGRES::QUERY = "CREATE TABLE test_data (field1 INTEGER NOT NULL, field2 TEXT" CL-POSTGRES:ROW-READER = CL-POSTGRES:IGNORE-ROW-READER