Skip to content

Commit bf92c51

Browse files
committed
updated doc
1 parent ab8c930 commit bf92c51

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

README.adoc

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ endif::[]
1010

1111
Redis Input/Output Tool (RIOT) is a data import/export tool for Redis and Redis Modules.
1212

13-
== Input Sources
14-
15-
* Databases: JDBC
13+
== Inputs
14+
* Databases: any JDBC driver
1615
* Files: delimited (CSV), fixed-width, JSON
17-
* Generator: https://github.com/stympy/faker[Faker], simple
16+
* Generator: https://github.com/stympy/faker[Faker], simple
17+
18+
== Outputs
19+
* Databases: any JDBC driver
20+
* Files: delimited (CSV), formatted, JSON
1821

1922
== Installation
2023
Download the https://github.com/Redislabs-Solution-Architects/riot/releases/latest[latest RIOT distribution] (zip or tar.gz) and unpack the downloaded archive.
@@ -36,7 +39,7 @@ WARNING: Add the appropriate driver jar for your database under the `lib` direct
3639
For example with MySQL: `lib/mysql-connector-java-5.1.47.jar`
3740

3841
=== JSON
39-
RIOT can read JSON data from a file with the following format:
42+
RIOT can read and write JSON data in the following format:
4043
[source,plaintext]
4144
----
4245
[
@@ -59,7 +62,7 @@ This data generator relies on the https://github.com/DiUS/java-faker[Faker] libr
5962

6063
== Examples
6164

62-
=== Importing from databases
65+
=== Import from databases
6366
Let's import the following table from a MySQL database running locally:
6467
[source,plaintext]
6568
----
@@ -82,7 +85,7 @@ mysql> describe employees;
8285
riot import db --url "jdbc:mysql://localhost:3306/employees?serverTimezone=PST&useLegacyDatetimeCode=false&useSSL=false" --username root --password --sql "select * from employees" hash --keyspace employee --keys emp_no
8386
----
8487

85-
=== Importing CSV files
88+
=== Import CSV files
8689
Here is an excerpt of https://raw.githubusercontent.com/jpatokal/openflights/master/data/airports.dat[airports.dat] available at https://github.com/jpatokal/openflights[openflights]
8790
----
8891
1,"Goroka Airport","Goroka","Papua New Guinea","GKA","AYGA",-6.081689834590001,145.391998291,5282,10,"U","Pacific/Port_Moresby","airport","OurAirports"
@@ -105,7 +108,7 @@ riot import csv --url https://raw.githubusercontent.com/jpatokal/openflights/mas
105108
106109
----
107110

108-
=== Importing JSON files
111+
=== Import JSON files
109112
Here is an excerpt of beers.json available at https://github.com/rethinkdb/beerthink/blob/master/data/beers.json[beerthink]:
110113
[source,json]
111114
----
@@ -179,7 +182,7 @@ riot import json --url https://raw.githubusercontent.com/rethinkdb/beerthink/mas
179182
180183
----
181184

182-
=== Generating data
185+
=== Generate data
183186

184187
==== People
185188
[source,shell]
@@ -219,6 +222,23 @@ riot import --max 100 gen --field name=faker.gameOfThrones.character set --keysp
219222

220223
These are the https://github.com/DiUS/java-faker[Faker generators] available:
221224

222-
`address, ancient, app, artist, avatar, beer, book, bool, business, cat, chuckNorris, code, color, commerce, company, country, crypto, currency, dateAndTime, demographic, dog, dragonBall, educator, esports, file, finance, food, friends, funnyName, gameOfThrones, hacker, harryPotter, hipster, hitchhikersGuideToTheGalaxy, hobbit, howIMetYourMother, idNumber, internet, job, leagueOfLegends, lebowski, lordOfTheRings, lorem, matz, medical, music, name, number, options, overwatch, phoneNumber, pokemon, randomService, rickAndMorty, robin, rockBand, shakespeare, slackEmoji, space, starTrek, stock, superhero, team, twinPeaks, university, weather, witcher, yoda, zelda`
225+
`address, ancient, app, artist, avatar, beer, book, bool, business, cat, chuckNorris, code, color, commerce, company, country, crypto, currency, dateAndTime, demographic, dog, dragonBall, educator, esports, file, finance, food, friends, funnyName, gameOfThrones, hacker, harryPotter, hipster, hitchhikersGuideToTheGalaxy, hobbit, howIMetYourMother, idNumber, internet, job, leagueOfLegends, lebowski, lordOfTheRings, lorem, matz, medical, music, name, number, options, overwatch, phoneNumber, pokemon, randomService, rickAndMorty, robin, rockBand, shakespeare, slackEmoji, space, starTrek, stock, superhero, team, twinPeaks, university, weather, witcher, yoda, zelda`
226+
227+
=== Export to Databases
228+
229+
[source,shell]
230+
----
231+
export --keyspace beer --keys id db --url "jdbc:mysql://localhost:3306/employees?serverTimezone=PST&useLegacyDatetimeCode=false&useSSL=false" --username root --password --sql "INSERT INTO beers (id, name, style_name) VALUES (:id, :name, :style_name)"
232+
----
223233

234+
=== Export to CSV
235+
[source,shell]
236+
----
237+
export --keyspace beer --keys id csv --file export-beers.csv --names id name brewery_id abv --header
238+
----
224239

240+
=== Export to JSON
241+
[source,shell]
242+
----
243+
export --keyspace beer --keys id json --file export-beers.json
244+
----

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>com.redislabs</groupId>
1414
<artifactId>riot</artifactId>
15-
<version>0.2.5</version>
15+
<version>0.3.0</version>
1616
<packaging>jar</packaging>
1717
<name>RIOT</name>
1818
<description>Redis Input/Output Tool</description>

0 commit comments

Comments
 (0)