apmckinlay / csuneido

The original C++ implementation of Suneido
GNU General Public License v2.0
7 stars 5 forks source link

Feature request - SQLite Tables - QuickJS/mujs integration #18

Open neimanpinchas opened 4 years ago

neimanpinchas commented 4 years ago

I have interest in suneido for a while, i've started many projects but i've not yet completed any project in Suneido, and switched over at end to something else.

I think and probably others too, that having the ability to store the some tables in an external database like SQLite, will give many times the opportunity to keep the complex logic in Suneido, but in the same time opening the data to another platform.

I guess we will need to make a new Table class, but i am not too good in c++, so i am unable to create it myself.

Another possibility could be an option to require an external javascript library into a Suneido class, and have the Functions callable, as we have 1000s of JS libraries in npmjs.com, this could be done by embedding some lightweight javascript interpreter in sundeido.

I would appriciate if someone can guide me how to add those things in suneido

I would apply some bounty on those projects if anyone want to do it, because i see it to be very beneficial.

apmckinlay commented 4 years ago

I understand why this would be attractive to some users. However, the best way to take advantage of Suneido is to use its built in database. If you want to use SQLite and JavaScript then you don’t really need Suneido.

One of Suneido’s features is that it is an integrated system. If you use an external database you lose this advantage.

Another issue is that Suneido’s database query language is not SQL. Much of the standard library would need to be modified to work with SQL.

neimanpinchas commented 4 years ago

I am not about replacing the database with SQLite, that would defeat the purpose of being integrated. I spoke about having the ability to have a single table backed by a SQLite table, That will not disturb novice users, but give some extra power to power users, and in one way give us a odbc driver for sunedio data.

To achieve that we need only to create a class exposing the same API as a Sundeido table, but using SQLIte on the storage side, we will need to make some flag in the Generic suneido table with the path and table name.

I can invest the time to do it, but i will need some guidance.

On Mon, Feb 24, 2020 at 3:55 PM Andrew McKinlay notifications@github.com wrote:

I understand why this would be attractive to some users. However, the best way to take advantage of Suneido is to use its built in database. If you want to use SQLite and JavaScript then you don’t really need Suneido.

One of Suneido’s features is that it is an integrated system. If you use an external database you lose this advantage.

Another issue is that Suneido’s database query language is not SQL. Much of the standard library would need to be modified to work with SQL.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apmckinlay/csuneido/issues/18?email_source=notifications&email_token=AEBHJLJGFPVFAUFV6BBJZRDREQX5ZA5CNFSM4KZ4SJ7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMZP2NA#issuecomment-590544180, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBHJLKNGHKHW3GZ3DS7MTDREQX5ZANCNFSM4KZ4SJ7A .

-- Pinchas S. Neiman 845.213.1229 #2

With Hashems help, from end to start

Yeshiva Net http://www.yeshivanet.commobile as my internet guard

Wizmage https://chrome.google.com/webstore/detail/wizmage-image-hider/ifoggbfaoakkojipahnplnbfnhhhnmlp?hl=encovers every image with a card

So I feel protected, safe, clever and smart

Yeshiva Net mobile, is fast, provider based, and easy to setup, with excellent customer service

If you need something category based, you may consider netsafepro.com http://netsafepro.com

apmckinlay commented 4 years ago

Ok, that seems reasonable. You would need to implement the same methods as the Table class, which are the virtual methods of the Query class. At some point the code would need to choose between the current Table class or the new SQLite table class.

We recommend using jSuneido (the Java version) for the database server (in client-server mode). That would mean making the changes to jSuneido rather than cSuneido. I don't know if there is a Java interface to SQLite.

neimanpinchas commented 4 years ago

https://sqljet.com/ Sounds good, its GPL licensed.

Can you please point out which class(es)? i need to duplicate. https://github.com/apmckinlay/jsuneido/blob/master/src/suneido/database/immudb/Table.java But i do not see there the insert logic.

Also what is regarding the Javascript modules idea

On Wed, Feb 26, 2020 at 11:24 AM Andrew McKinlay notifications@github.com wrote:

Ok, that seems reasonable. You would need to implement the same methods as the Table class, which are the virtual methods of the Query class. At some point the code would need to choose between the current Table class or the new SQLite table class.

We recommend using jSuneido (the Java version) for the database server (in client-server mode). That would mean making the changes to jSuneido rather than cSuneido. I don't know if there is a Java interface to SQLite.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apmckinlay/csuneido/issues/18?email_source=notifications&email_token=AEBHJLMDYXJKS3E2L34XVSTRE2JVVA5CNFSM4KZ4SJ7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENA44RQ#issuecomment-591515206, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBHJLNLYKWIFOEKLEC35OLRE2JVVANCNFSM4KZ4SJ7A .

-- Pinchas S. Neiman 845.213.1229 #2

With Hashems help, from end to start

Yeshiva Net http://www.yeshivanet.commobile as my internet guard

Wizmage https://chrome.google.com/webstore/detail/wizmage-image-hider/ifoggbfaoakkojipahnplnbfnhhhnmlp?hl=encovers every image with a card

So I feel protected, safe, clever and smart

Yeshiva Net mobile, is fast, provider based, and easy to setup, with excellent customer service

If you need something category based, you may consider netsafepro.com http://netsafepro.com

apmckinlay commented 4 years ago

You shouldn't need to modify the immudb stuff. It would be the query stuff - the Table class

https://github.com/apmckinlay/jsuneido/blob/master/src/suneido/database/query/Table.java

Table is constructed by TreeQueryGenerator (which is called by the query parser). One option would be to have a naming convention so if the table name started with sqlite_ then it would construct an instance of the SQLite table class.