Skip to content

Commit a91d211

Browse files
author
saa150
committed
(fix): added details of postgres and mysql in docs
1 parent 5e50232 commit a91d211

File tree

1 file changed

+93
-10
lines changed

1 file changed

+93
-10
lines changed

docs/source/user_guide/eda/create_db_report.ipynb

+93-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
"cell_type": "markdown",
2828
"metadata": {},
2929
"source": [
30-
"Creating SQLAlchemy `create_engine` object"
30+
"## Generate report via `create_db_report(sqlite_engine)`\n",
31+
"\n",
32+
"Here we provide with an example using SQLite database to demonstrate the functionality:"
3133
]
3234
},
3335
{
@@ -40,15 +42,6 @@
4042
"db_engine = load_db('sakila.db')"
4143
]
4244
},
43-
{
44-
"cell_type": "markdown",
45-
"metadata": {},
46-
"source": [
47-
"## Generate report via `create_db_report(database_engine)`\n",
48-
"\n",
49-
"Here we provide with an example using SQLite database to demonstrate the functionality:"
50-
]
51-
},
5245
{
5346
"cell_type": "code",
5447
"execution_count": null,
@@ -63,6 +56,96 @@
6356
"from dataprep.eda import create_db_report\n",
6457
"create_db_report(db_engine)"
6558
]
59+
},
60+
{
61+
"cell_type": "markdown",
62+
"metadata": {},
63+
"source": [
64+
"## Generate report via `create_db_report(mysql_engine)`\n",
65+
"\n",
66+
"Here we provide with an example using a MySQL database to demonstrate the functionality:"
67+
]
68+
},
69+
{
70+
"cell_type": "markdown",
71+
"metadata": {},
72+
"source": [
73+
"Creating SQLAlchemy `create_engine` connector for MySQL"
74+
]
75+
},
76+
{
77+
"cell_type": "code",
78+
"execution_count": null,
79+
"metadata": {},
80+
"outputs": [],
81+
"source": [
82+
"user = 'user'\n",
83+
"password = 'password'\n",
84+
"database_url=\"database-2.cnpnvdy4yt13.us-west-2.rds.amazonaws.com:3306/classicmodels\"\n",
85+
"mysql_engine = create_engine('mysql://' + user + ':' + password + database_url)"
86+
]
87+
},
88+
{
89+
"cell_type": "markdown",
90+
"metadata": {},
91+
"source": [
92+
"Running `create_db_report` on MySQL database hosted on Amazon RDS"
93+
]
94+
},
95+
{
96+
"cell_type": "code",
97+
"execution_count": null,
98+
"metadata": {},
99+
"outputs": [],
100+
"source": [
101+
"from dataprep.eda import create_db_report\n",
102+
"create_db_report(mysql_engine)"
103+
]
104+
},
105+
{
106+
"cell_type": "markdown",
107+
"metadata": {},
108+
"source": [
109+
"## Generate report via `create_db_report(postgreSQL_engine)`\n",
110+
"\n",
111+
"Here we provide with an example using a local postgreSQL database to demonstrate the functionality:"
112+
]
113+
},
114+
{
115+
"cell_type": "markdown",
116+
"metadata": {},
117+
"source": [
118+
"Creating SQLAlchemy `create_engine` connector for PostgreSQL"
119+
]
120+
},
121+
{
122+
"cell_type": "code",
123+
"execution_count": null,
124+
"metadata": {},
125+
"outputs": [],
126+
"source": [
127+
"user = 'user'\n",
128+
"password = 'password'\n",
129+
"database_url='@localhost:5432/classicmodels'\n",
130+
"postgresql_engine = create_engine('postgresql://' + user + ':' + password + database_url)"
131+
]
132+
},
133+
{
134+
"cell_type": "markdown",
135+
"metadata": {},
136+
"source": [
137+
"Running `create_db_report` on local PostgreSQL database"
138+
]
139+
},
140+
{
141+
"cell_type": "code",
142+
"execution_count": null,
143+
"metadata": {},
144+
"outputs": [],
145+
"source": [
146+
"from dataprep.eda import create_db_report\n",
147+
"create_db_report(postgresql_engine)"
148+
]
66149
}
67150
],
68151
"metadata": {

0 commit comments

Comments
 (0)