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

Record types and SQLite output #2457

Open
cd1m0 opened this issue Dec 18, 2023 · 4 comments
Open

Record types and SQLite output #2457

cd1m0 opened this issue Dec 18, 2023 · 4 comments

Comments

@cd1m0
Copy link

cd1m0 commented Dec 18, 2023

I have an analysis generating a record type (int list) and I'm dumping it into an SQLite database. When I read it out I see an integer which I assume is an index into the record table. However I don't see any record table in the generated sqlite database? Is this expected?

To reproduce you can use the following sample:

.type IntList = [ head: number, tail: IntList ]
.decl R(x: IntList)

R([1, [2, [3, nil]]]).
.output R(IO=sqlite, dbname="tmp1.sqlite")

The resulting database:

sqlite3 tmp1.sqlite 
SQLite version 3.42.0 2023-05-16 12:36:15
Enter ".help" for usage hints.
sqlite> .tables
R              _R             __SymbolTable
sqlite> select * from _R;
3
sqlite> select * from __SymbolTable;
sqlite> select * from R;
3
sqlite> 

@quentin
Copy link
Member

quentin commented Dec 18, 2023

Hi, it is a known limitation of the current SQLite output.

@cd1m0
Copy link
Author

cd1m0 commented Dec 19, 2023

Are there any plans to fix this?

@quentin
Copy link
Member

quentin commented Dec 20, 2023

There are no plan to fix this at the moment.

Enhancing the sqlite output would require:

  • specification of the sqlite schema for the record table,
  • implementation in the sqlite writer,
  • symmetrical implementation in the sqlite reader.

@cd1m0
Copy link
Author

cd1m0 commented Dec 20, 2023

Can you provide detail on the `specification of the sqlite schema for the record table"?

Is it:

  1. meant to look the same way as in the CSV output, where the record type is seralized to a string and placed as a symbol in a single column

OR

  1. Have one "record" table per record type that lists the ids of fields/symbols

If you provide some context on how you want it to work I can take a stab at fixing it

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