realm-browser-osx icon indicating copy to clipboard operation
realm-browser-osx copied to clipboard

Import/Export different data formats

Open TimOliver opened this issue 10 years ago • 12 comments

Import Formats

  • JSON
  • CSV
  • SQLite
  • Excel
  • SQL (Create and Insert)

Export Formats

  • JSON
  • CSV

TimOliver avatar Jun 19 '15 22:06 TimOliver

+1. Really need it . Especially when we want to deliver app with db files.

lidemin avatar Aug 13 '15 03:08 lidemin

Thanks for that!

Are there any particular formats there you're interested in? I'm still wondering which ones to prioritize.

TimOliver avatar Aug 13 '15 03:08 TimOliver

@TimOliver Thanks! Actually I was trying to use some CSV data and found that Realm Browser does not support it now. Really appreciate it.

lidemin avatar Aug 13 '15 03:08 lidemin

Is there a workaround to export the Realm data as CSV/JSON/whatever until the Realm Browser supports this?

muenchdo avatar Sep 05 '15 13:09 muenchdo

@muenchdo until the Realm browser supports this natively, you could write an app to convert the data using a Realm binding (Realm Cocoa or Realm Java).

jpsim avatar Sep 07 '15 19:09 jpsim

We badly need this. Any kind of structured export would be better than nothing - CSV or JSON sound sensible to me, whatever is easier to implement.

I've tried writing a CSV export app in Java with realm-java, but hit issues with Android dependencies. I'll give it another go this evening and share if I get anywhere.

In the meanwhile, because all our data is stored as JSON as strings in our Realm databases anyway, I've just been using a little bash script to pull out anything in curly braces and dump it in a file...

cat REALM_DATABASE_FILENAME | grep -aoE '\{..+?\}' | split -l 1 - realmdata; 

for file in realmdata*
do
    cat $file | sed 's/\\//g' > $file.txt;
    rm $file; 
done

beveradb avatar Nov 19 '15 13:11 beveradb

Seems like it's only possible to import one table only. Importing another CSV file to create/populate another table overwrites the previous database.

The XSLX is able to create multiple tables, but doesn't populate any of them.

Also, no way to specify the schema? It creates all columns as strings.

Am I missing something or is this almost useful?

basememara avatar May 04 '16 09:05 basememara

Hi @basememara!

Thanks for the feedback! The importing/exporting components of the Browser are actually maintained in a separate project named the Realm Converter.

The converter is still heavily under construction (Each format is at varying levels right now), so if there's any particular feature/fix you'd like, please file them as issues over in that repo. :)

Thanks a lot!

TimOliver avatar Jun 08 '16 06:06 TimOliver

What is the timeline for building this? There have been a few react-native users asking for JSON import support.

alazier avatar Jul 21 '16 14:07 alazier

A primitive version of this should be super easy to build, I don't know why it's been pushed off for so long. I'm assigning myself to this.

jpsim avatar Jul 21 '16 18:07 jpsim

a json importer was added in realm/realm-cocoa-converter#16. we can keep this open until an exporter is also added, and of course, until these are integrated into the browser.

jpsim avatar Jul 21 '16 22:07 jpsim

any updates on this feature?

rickrvo avatar May 01 '20 22:05 rickrvo