Re: Using Clojure for complex database driven applications
Hi, Am 12.07.2009 um 02:14 schrieb Eugen Dueck: Sure. It is currently just a k. Will add it tomorrow. In case I want to make changes to it, what's the preferred way to submit patches? I'm not familiar with git yet, but willing to learn. I only need a keyword, like "do a github pull request". Or plain old patches? But then again you probably wouldn't be using git, right? I must confess I don't like pull requests. They only work when everyone adheres to the same coding and commiting standards. This is certainly ok for subsystem maintainers communicating with Linus. But it almost never holds for arbitrary contributions by others. For my projects I seldom get a patch (or pull request), which is usable without any processing... Hence I normally prefer goode olde patches. This makes any processing needed easier. However a clean patch with clean commit history may also be submitted via pull request. I'll talk to Lau on that question and we will put up a HACKING file or so... Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature
Re: Using Clojure for complex database driven applications
On Jul 12, 3:37 am, Meikel Brandmeyer wrote: > May I add your patch to clojureql? Sure. It is currently just a * copy-and-paste of oll files containing the word mysql * basically search-and-replace mysql => postgresql * small changes to the auto-inc and primary key stuff In case I want to make changes to it, what's the preferred way to submit patches? I'm not familiar with git yet, but willing to learn. I only need a keyword, like "do a github pull request". Or plain old patches? But then again you probably wouldn't be using git, right? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Using Clojure for complex database driven applications
Hi, Am 11.07.2009 um 19:04 schrieb Eugen Dueck: I wrote postgres support for clojureql. It's my first shot, but the demo runs through from start to finish. May I add your patch to clojureql? Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature
Re: Using Clojure for complex database driven applications
I wrote postgres support for clojureql. It's my first shot, but the demo runs through from start to finish. Of course you need postgres jdbc drivers, e.g. http://jdbc.postgresql.org/download/postgresql-8.4-701.jdbc4.jar * dk/bestinclass/clojureql/backend/postgresql.clj: (clojure.core/ns dk.bestinclass.clojureql.backend.postgresql (:require [dk.bestinclass.clojureql :as cql] [dk.bestinclass.clojureql.util :as util])) (defmethod cql/compile-sql [::cql/CreateTable org.postgresql.PGConnection] [stmt db] (let [{:keys [table columns options]} stmt] (apply str (list "CREATE TABLE " table " (" (util/str-cat ", " (map #(str (first %) " " (if (= (first %) (:auto-inc options)) "SERIAL" (second %)) (when (= (first %) (:not- null options)) " NOT NULL ")) columns)) (when-not (nil? (:primary-key options)) (format ", PRIMARY KEY (\"%s\")" (:primary-key options))) ") " (prefer-method cql/compile-sql [::cql/CreateTable org.postgresql.PGConnection] [::cql/CreateTable ::cql/Generic]) * dk/bestinclass/clojureql/demos/postgresql.clj: (ns dk.bestinclass.clojureql.demos.postgresql (:gen-class) (:require [dk.bestinclass.clojureql :as sql] [dk.bestinclass.clojureql.backend.postgresql :as postgresql])) ; Adapt the following connection-info to your local database. (def *conn-info* (sql/make-connection-info "postgresql" ; Type "//localhost/cql"; Adress and db (cql) "cql"; Username "cql")) ; Password (sql/load-driver "org.postgresql.Driver") (load "common") --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Using Clojure for complex database driven applications
Hi, Am 08.07.2009 um 12:10 schrieb Baishampayan Ghose: How mature are they? Do they work well with PostgreSQL? Apparently, ClojureQL doesn't. ClojureQL is not very mature at the moment. Eg. the join syntax will change soon. Other parts need clean up. Basic things are still missing. We cannot test all database backends. And there are as much special cases as there are backends. So if anyone wants to lend a hand in making CQL fit for a backend, we are happy to accept any support. Examples are already there for MySQL and Derby. Eg. FULL JOIN is emulated, since both backends don't support it. Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature
Re: Using Clojure for complex database driven applications
Lau, one of the co-developer sad he was working on pgsql, I haven't tried it with pgsql. I'm sure he'll jump in here. :) As for maturity, apprently 1.0 release is near. I only tried some limited queries so far. You should stress test it for your project. On 7/8/09, Baishampayan Ghose wrote: > Wilson MacGyver wrote: >> Take a look at ClojureQL >> >> http://github.com/Lau-of-DK/clojureql/tree/master >> >> It's not a ORM system like SQLAlchemy/Django ORM in that >> it won't "manage" the table schema for you. >> >> There is also clj-record. >> >> http://github.com/duelinmarkers/clj-record/tree/master >> >> which is inspired by rail's ActiveRecord. > > How mature are they? Do they work well with PostgreSQL? Apparently, > ClojureQL doesn't. > > Regards, > BG > > -- > Baishampayan Ghose > oCricket.com > > -- Sent from my mobile device Omnem crede diem tibi diluxisse supremum. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Using Clojure for complex database driven applications
Check out clj-record modelled around Rails' ActiveRecord. http://elhumidor.blogspot.com/2009/01/clj-record-activerecord-for-clojure.html http://github.com/duelinmarkers/clj-record/tree/master -Suresh On Wed, Jul 8, 2009 at 3:29 PM, Baishampayan Ghose wrote: > Hello, > > So we are going to develop a moderately complex Database driven > application in Clojure and I am looking for easy-to-manage solutions for > talking to Databases. > > I am quite used to the way Object Relational Mappers like SQLAlchemy & > Django work in the Python world. > > We define the DB schema using simple classes and then we access and > manipulate the DB using objects and their properties/methods. > > I would prefer a similar setup for Clojure as I would rather not deal > with any kind of raw SQL. > > I am also a Java newbie; and I am currently looking at Hibernate (and > may be Spring to make Hibernate less verbose). > > I would like to know how you have solved similar problems. > > Is Hibernate useful? Is managing a bunch of XML config files a necessary > evil? > > Any help will be appreciated. > > Regards, > BG > > -- > Baishampayan Ghose > oCricket.com > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Using Clojure for complex database driven applications
> > I am quite used to the way Object Relational Mappers like SQLAlchemy & > Django work in the Python world. > I've recently thought that a good project would be to port SQLAlchemy to Clojure. It wouldn't be a straight port since the languages are so different, but at least SQLAlchemy's query generation stuff against a reflected schema would be great. Maybe ClojureQL gets close to this though, I haven't worked with it enough yet to know. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Using Clojure for complex database driven applications
Wilson MacGyver wrote: > Take a look at ClojureQL > > http://github.com/Lau-of-DK/clojureql/tree/master > > It's not a ORM system like SQLAlchemy/Django ORM in that > it won't "manage" the table schema for you. > > There is also clj-record. > > http://github.com/duelinmarkers/clj-record/tree/master > > which is inspired by rail's ActiveRecord. How mature are they? Do they work well with PostgreSQL? Apparently, ClojureQL doesn't. Regards, BG -- Baishampayan Ghose oCricket.com signature.asc Description: OpenPGP digital signature
Re: Using Clojure for complex database driven applications
Take a look at ClojureQL http://github.com/Lau-of-DK/clojureql/tree/master It's not a ORM system like SQLAlchemy/Django ORM in that it won't "manage" the table schema for you. There is also clj-record. http://github.com/duelinmarkers/clj-record/tree/master which is inspired by rail's ActiveRecord. On Wed, Jul 8, 2009 at 5:59 AM, Baishampayan Ghose wrote: > Hello, > > So we are going to develop a moderately complex Database driven > application in Clojure and I am looking for easy-to-manage solutions for > talking to Databases. > > I am quite used to the way Object Relational Mappers like SQLAlchemy & > Django work in the Python world. > > We define the DB schema using simple classes and then we access and > manipulate the DB using objects and their properties/methods. > > I would prefer a similar setup for Clojure as I would rather not deal > with any kind of raw SQL. > > I am also a Java newbie; and I am currently looking at Hibernate (and > may be Spring to make Hibernate less verbose). > > I would like to know how you have solved similar problems. > > Is Hibernate useful? Is managing a bunch of XML config files a necessary > evil? > > Any help will be appreciated. > > Regards, > BG > > -- > Baishampayan Ghose > oCricket.com > > -- Omnem crede diem tibi diluxisse supremum. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Using Clojure for complex database driven applications
Hello, So we are going to develop a moderately complex Database driven application in Clojure and I am looking for easy-to-manage solutions for talking to Databases. I am quite used to the way Object Relational Mappers like SQLAlchemy & Django work in the Python world. We define the DB schema using simple classes and then we access and manipulate the DB using objects and their properties/methods. I would prefer a similar setup for Clojure as I would rather not deal with any kind of raw SQL. I am also a Java newbie; and I am currently looking at Hibernate (and may be Spring to make Hibernate less verbose). I would like to know how you have solved similar problems. Is Hibernate useful? Is managing a bunch of XML config files a necessary evil? Any help will be appreciated. Regards, BG -- Baishampayan Ghose oCricket.com signature.asc Description: OpenPGP digital signature