Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API for bulk inserts #54

Open
essenciary opened this issue Apr 28, 2022 · 2 comments
Open

Add API for bulk inserts #54

essenciary opened this issue Apr 28, 2022 · 2 comments

Comments

@essenciary
Copy link
Member

For backends that support it.
Similar to, for MySQL:

  • LOAD DATA INFILE
  • Bulk inserts (INSERT INTO): INSERT INTO class_result VALUES (1,’John’,’A’),(2,’Elsa’,’D’),(3,’Sophia’,’B’),(4,’Paul’,’B’),(5,’Saira’,’A’)
@honghuzi
Copy link

In the case of inserting a DataFrame to the SQLite database, it might be a good idea to use SQLite.jl package

  cols = [] # cols for the model definition
  db = SQLite.DB("db/temp.sqlite")
  n = count(MyModel)
  df = df[!, cols]
  df |> SQLite.load!(db, "temp")

@essenciary
Copy link
Member Author

Yes - but the point is to have a common API for bulk inserts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants