0xPolygonMiden / miden-client

Client library that facilitates interaction with the Miden rollup
MIT License
27 stars 23 forks source link

Utilize `rarray` extension for SQL queries #287

Closed igamigo closed 2 months ago

igamigo commented 2 months ago

What should be done?

In the SqliteStore, in places where we search for multiple entities (such as get_block_headers()), we format the SQL query to use IN () statements. We should likely enable the rarray extension and use that. This way we avoid formatting the query which can lead to SQL injections.

Additionally, we should implement a way to retrieve multiple InputNoteRecords in one query only. This should be used from the data store in order to get all inputs as once.

How should it be done?

We should enable the extension and implement the queries like in this example.

When is this task done?

When we don't format the SQL statements and use rarray instead.

Additional context

No response

mFragaBA commented 2 months ago

294 added the usage of rarray and got merged, so once #312 gets merged we should be able to close this