Arc Forumnew | comments | leaders | submitlogin
2 points by jmatt 5498 days ago | link | parent

In the past I have gotten a sqlite C binding working through an old alpha version of the ffi. It was never completely stable and was failing in the ffi. But it was doable. I had limited time and couldn't hunt down where it was failing in the ffi. I didn't have any requirements to use the FFI and was just exploring the possibility. So I moved back to SQLite using JGC's TCP server [1]. Which was a great solution! It wasn't especially portable between mac and linux (ie deploying it to my web server). But it was fast to set up and robust on the mac.

Similarly I worked on MySQL bindings but they were never robust enough to use especially in comparison to the JGC solution. This was a few versions ago before the ffi was flushed out. Maybe a similar TCP server using MySQL would make sense. I know it worked really well for me. I had problems making it portable (between Ubuntu / FreeBSD). But after those problems were worked out it was stable.

Good luck. I'm interested in what ends up working for you.

[1] http://www.jgc.org/blog/2008/02/interface-to-sqlite-database...



4 points by thaddeus 5497 days ago | link

Thanks for the reply.

I ended up using dbslayer to interface with mysql. And along with aw's json combinator + stefano's? http-get/utils - it works brilliantly!

http://code.nytimes.com/projects/dbslayer

http://awwx.ws/combinator/

http://github.com/nex3/arc/tree/arc2.master/lib/http-get/

One note: I needed to change the dbslayer source code, prior to making the install, in order to eliminate the spaces that aw's combinator would choke on. It was a trivial change though...

[EDIT: Correction I was using an older version of aw's combinator - the new version handles spaces]

T.

-----

1 point by aw 5497 days ago | link

That's cool. It's a neat idea that by default (if there isn't an explicit reason why you have to do something else), all interfaces can be HTTP, and as a bonus use JSON as your data interchange format...

-----

1 point by thaddeus 5496 days ago | link

Exactly. The concept is great. Even now when I am starting to learn haskell, the first thing I am doing checking out haskells' JSON parser to communicate via HTTP. Conceptually I can keep doing this and communicate easily across any language. And since SQL to URL is so basic I can re-use/apply dbslayer to any language too.

-----

1 point by aw 5496 days ago | link

Aha, I knew I'd seen some post that talked about this, and I found it: http://timothyfitz.wordpress.com/2009/02/12/why-http/

-----