File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -227,3 +227,56 @@ if __name__ == "__main__":
227
227
228
228
uvicorn.run(app, host = " 127.0.0.1" , port = 5000 )
229
229
```
230
+
231
+
232
+ ### Configuration Examples
233
+
234
+ ``` python
235
+ # SQLite in memory database
236
+ config = {
237
+ " database_uri" : " sqlite+aiosqlite:///:memory:?cache=shared" ,
238
+ " echo" : False ,
239
+ " future" : True ,
240
+ " pool_recycle" : 3600 ,
241
+ }
242
+ ```
243
+
244
+ ``` python
245
+ # PostgreSQL database
246
+ config = {
247
+ " database_uri" : " postgresql+asyncpg://postgres:postgres@postgresdb/postgres" ,
248
+ " echo" : False ,
249
+ " future" : True ,
250
+ " pool_recycle" : 3600 ,
251
+ }
252
+ ```
253
+
254
+ ``` python
255
+ # MySQL database
256
+ config = {
257
+ " database_uri" : " mysql+aiomysql://root:root@localhost/test" ,
258
+ " echo" : False ,
259
+ " future" : True ,
260
+ " pool_recycle" : 3600 ,
261
+ }
262
+ ```
263
+
264
+ ``` python
265
+ # SQL Server database
266
+ config = {
267
+ " database_uri" : " mssql+aiomssql://sa:yourStrong(!)Password@localhost:1433/master" ,
268
+ " echo" : False ,
269
+ " future" : True ,
270
+ " pool_recycle" : 3600 ,
271
+ }
272
+ ```
273
+
274
+ ``` python
275
+ # Oracle database
276
+ config = {
277
+ " database_uri" : " oracle+oracledb_async://scott:tiger@localhost/?service_name=XEPDB1" ,
278
+ " echo" : False ,
279
+ " future" : True ,
280
+ " pool_recycle" : 3600 ,
281
+ }
282
+ ```
You can’t perform that action at this time.
0 commit comments