Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpablo/django-bulk-insert
Bulk insert django objects into mysql databases
https://github.com/jpablo/django-bulk-insert
Last synced: 10 days ago
JSON representation
Bulk insert django objects into mysql databases
- Host: GitHub
- URL: https://github.com/jpablo/django-bulk-insert
- Owner: jpablo
- Created: 2011-06-28T23:38:43.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-06-29T22:02:56.000Z (over 13 years ago)
- Last Synced: 2024-11-14T00:53:43.335Z (about 2 months ago)
- Homepage:
- Size: 93.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mysql Bulk Insert
Bulk-inserts django objects by generating the sql as text and using cursor.execute()
## Example usage:
```python
from mysql_bulk_insert import bulk_insert
objects = [o1,o2,o3,...]
bulk_insert(objects)
```If you want to inspect the generated sql instead:
```python
bulk_insert(objects, show_sql=True)
```## limitations
bulk_insert doesn't follow references to other models.
It just outputs the foreign key.
If you have a hierarchy of objects, you need to save each group of objects in the correct order.
(Or submit a patch :) )bulk_insert only knows about mysql.
Cheers!