incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Binns <rog...@rogerbinns.com>
Subject Re: Bulk CSV import?
Date Thu, 14 Jan 2010 20:58:36 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian Candler wrote:
> But what about importing? 

Although CSV may seem trivial, it is actually a nightmarish format.  No two
programs do exactly the same thing.  If CouchDB accepted CSV directly there
would be all sorts of extra parameters that would need to be supplied.  For
example when are columns or values considered numbers?  (A sequence of
digits is not a good test since they could be a phone number and an 'e'
within the digits could really just be a letter or it could be part of a
real.)  Similarly if the row has a zero length for one column, what do you
translate that into?  (A zero length string? null? Omit the key for that
doc?)  See the SQLite mailing list for frequent postings about CSV and that
is for a system that has supported CSV import and export for almost a decade!

That said, if you do want to import CSV may I suggest using APSW.  It has an
interactive shell so you do not need to know or care about Python.  APSW
comes with a module that bridges between SQLite and CouchDB.  You can do the
CSV import, data typing and cleanup using SQLite and then push the results
into CouchDB:

  http://apsw.googlecode.com/svn/publish/couchdb.html#importing-csv-data

[Disclaimer: I am the author of APSW]

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAktPhXwACgkQmOOfHg372QTuGgCgq0euhxljlroRVQGSn8wVWMrl
tTUAoI01G33qbQ6csJaINSA7NXXMawbh
=G3ju
-----END PGP SIGNATURE-----

Mime
View raw message