E
E
estry2021-04-06 21:23:37
SQLite
estry, 2021-04-06 21:23:37

How to add data from dictionary in sqlite c#?

Hello.

There is data in the dictionary. How to add them to the sqlite database?
Moreover, it is not known how many key:value pairs can be in the dictionary. And also, when receiving the next portion of the dictionary, there may be more pairs than in the previous one. And then to the existing columns in the table, you need to add new ones in accordance with the keys in the dictionary.
How can this be implemented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Romses Panagiotis, 2021-04-06
@romesses

Build a table with a unique index on a key.
Add like this:
INSERT or IGNORE INTO x VALUES (...);

V
Vasily Bannikov, 2021-04-06
@vabka

It seems that you want to use sqlite in a wrong way somehow.
You can use Entity-Attribute-Value
pattern Or you can use NoSQL DBMS - LiteDB

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question