question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQL for bulk insert

See original GitHub issue

support syntax for insert of multiple rows at once:

INSERT INTO table_name (column_list)
VALUES
    (value_list_1),
    (value_list_2),
    ...
    (value_list_n);

Unknowns

Investigate if PostgreSQL supports bind variables in statement like that.

Implementation

It is very likely this insert will need to be executed without creating intermediate model. The existing QuestDb’s implementation of Insert is also deficient and this is an opportunity to prove it.

Considerations

  • insert should convert constant types similarly to how BindVariableService does. In that it should be possible to insert null into primitive types, such as int, long etc. It should also be possible to insert constant int into short and byte column, numeric value into char column etc.

  • The implementation should be efficient and performant for frequent execution of insert statements

  • The implementation must not generate grabage

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jerrinotcommented, May 25, 2022

hi @Shivansh-Mittal you parse the JSON file in C# and then use a Postgres client to connect to QuestDB and use SQL bulk update as documented here

0reactions
Shivansh-Mittalcommented, May 25, 2022

Can I insert json file data in my questdb table from C# ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

BULK INSERT (Transact-SQL) - SQL Server - Microsoft Learn
The BULK INSERT statement can be executed within a user-defined transaction to import data into a table or view. Optionally, to use multiple ......
Read more >
SQL Server BULK INSERT
Introduction to the SQL Server BULK INSERT statement · First, specify the name of the table in the BULK INSERT clause. Note that...
Read more >
Bulk Insert Data into SQL Server
The first argument for BULK INSERT should be a table name or a view name. · The second argument is the name of...
Read more >
Guide to How Bulk Insert in SQL with Sample Queries - eduCBA
Introduction to SQL Bulk Insert ... Normal insert statements will only insert one row at a time into the database. But if you...
Read more >
SQL Server Bulk Insert – Part 1 - {coding}Sight
According to Wikipedia, ”A Bulk insert is a process or method provided by a database management system to load multiple rows of data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found