Search code examples
mysqlreactjsdata-modelingreact-admin

SQL Database that React-Admin Demo Project is using


React-Admin source is using fake data for development. https://github.com/marmelab/react-admin

In its document, I found one external Data Provider's sources, Xmysql: soaserele/aor-xmysql. https://marmelab.com/react-admin/DataProviders.html

I want to run their demo project with xmysql data provider. For that, I need to set up mysql database with same dataset from demo project.

  • Where they fetched the demo data?
  • There is any way to get SQL file of react-admin demo project' dataset?
  • Or anyone can create SQL file from the demo dataset easily? I uploaded the react-admin demo project's data.

https://www.dropbox.com/sh/amac5khh7pi542v/AAA3OsN-BMhAheJBTigx1MRNa?dl=0

react-admin's demo data


Solution

  • The demo data is generated client-side by a utility called data-generator (see https://github.com/marmelab/react-admin/tree/master/examples/data-generator).

    This utility can be used in standalone, in which case you can use it to generate a JSON (but not SQL).

    So the only way to get SQL from that JSON is to use an online converter (like http://convertjson.com/json-to-sql.htm). Alternately, load the JSON directly in MySQL using the LOAD DATA INFILE statement (see https://mysqlserverteam.com/taking-the-new-mysql-5-7-json-features-for-a-test-drive/).