Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Martin Jonsson
    @Allam76
    That is the InanoSQLTableColumn.immutable is set to true.
    Also found a little bug in query.ts 1828 immutable: dataModels[d].immutalbe || false, :smile:
    Martin Jonsson
    @Allam76
    seems the problem is that I use TEMP storage that sets deepFreeze by default. There is a property in the constructor useLS that is never used...
    Martin Jonsson
    @Allam76
    With sqlite driver in node.js it all works as expected. One could possibly use TEMP storage in node.js by importing the module separately and set localStorage on the global scope.
    mark134340
    @mark134340
    Can't rocksdb and leveldb be used in the electron render process?
    Scott Lott
    @ClickSimply
    I think it’s possible, not sure how to accomplish it.
    mark134340
    @mark134340
    "The level package is the recommended way to get started. It conveniently bundles levelup, leveldown and encoding-down. Its main export is levelup - i.e. " But this package can be used in the electron render process. I don't know the detailed difference between level and levelup.
    Scott Lott
    @ClickSimply
    levelup is an abstract key-value api that can be used to access any compatible backend. For example, you can use levelup with any leveldown compatible backend, like rocksdb.
    leveldown is the raw LevelDB backend with C++ compiling.
    you can use levelup with indexedDB based storage, so it works in the browser. leveldown and rocksdb depend on native compiltion and only work in NodeJS
    Adam AUTUORI
    @Askeridos
    hello
    Scott Lott
    @ClickSimply
    hello
    Neville Franks
    @getclibu_twitter
    @ClickSimply Scott, I've been meaning to raise this for a while and my need is back again today. It would be really useful if 'upsert' returned the original doc/row in addition to the updated/added doc/row. My use case is in order to update a 'full text search index' I need the original and updated rows. A further benefit is one can then tell if a row was inserted or updated, as their would be no original row for an insert. There are times where I need to know if a row was inserted vs. added.
    Adam AUTUORI
    @Askeridos
    Hello.
    I have a problem: in the examples of documentation, the stuff returned by select query are plain-JSON objects.
    When i'm querying the database for a select, the result is stringyfied. Also, I can't transform the result with JSON.parse() 'cos it returns me an Unexpected EOF error.
    I want to implement the result in a FlatList (in reactnative) 'cos a key object is needed for its keyExtractor attribute.
    Here's the object where keys are string :
    {"key":1,"name":"baguette","weight":280}
    Adam AUTUORI
    @Askeridos
    I resolved my problem
    Scott Lott
    @ClickSimply
    Cool
    Neville Franks
    @getclibu_twitter
    @ClickSimply Is there any way to prevent properties with undefined values being included in a row? I've read through https://nanosql.io/query/create-table.html#making-tables and can't see anything of use.
    Also any cmt on my post above - Apr 21?
    Nikkolai Fernandez
    @nikkolai14
    Hello Guys, I am planning to use this on a nativescript app, but I can't find on the doc if this does support acid transaction which I believe sqlite supports it right? thank you :)
    LeftWild
    @LeftWild
    Heyo, by any chance have you guys ever had the problem of auto increment in SQLite? its returning "sqlite3_prepare_v2 failure: no such table: _ai"
    Chrizzly
    @Chris2011
    Hey people, I have a problem while building. I use @nano-sql 2 and the adapter-sqlite-cordova and my app is build with TS. When I build I got this error: Cannot find name SQLResultSet when I import import { getMode } from '@nano-sql/adapter-sqlite-cordova';. All of my packages are up to date, what cordova and nano-sql means. Is there a typing missing? When I click on that error it jumps into the index.d.ts of the specific adapter and on line 6 it is red marked.
    Any ideas?
    image.png
    Chrizzly
    @Chris2011
    Ok this type is from websql as mentioned of the reference comment on top of the file. Will try to add them to the tsconfig. They exist in the node_modules folder.
    Chrizzly
    @Chris2011
    Ok my fault, I added the missing types to the upper node_modules folder. They only existed in the src-cordova node_modules :) Now no problems.
    Scott Lott
    @ClickSimply
    excellent, glad you got it working!
    I need to go through and do a bunch of udpates to NanoSQL 2 and answer the outstanding issues, just been really busy with other things. Covid hasn’t helped!
    Chrizzly
    @Chris2011
    I have another problems with the ready event and the sqlite adapter. I don't get my db calls on my phone working.
    I used createDatabase but this is not correct, I just tried connect, but I don't know where my sqlite db file needs to be placed in the folder structure and how I say -> use this db file
    the nSQL().on('ready') never fired
    And I thought syntax is this: use connect and add dummy tables to your tables array (If you use the Desktop browser for test) and this array will be skipped as if the real db file will be found, right?
    Chrizzly
    @Chris2011

    I need to go through and do a bunch of udpates to NanoSQL 2 and answer the outstanding issues, just been really busy with other things. Covid hasn’t helped!

    No problem, I hoped that the project is still alive. I didn't find another one. Last commit was in october.

    @ClickSimply and also, hope that you are fine and thx for responding anyway :)
    Scott Lott
    @ClickSimply
    @Chris2011 That’s not right at all, nanoSQL uses a special format for the tables and data, there’s not really an easy way to map nanoSQL onto an existing SQLite database.
    nanoSQL needs to manage the database from the beginning, when you choose SQLite you’re just choosing the format nanoSQL saves the database in.
    For example, nanoSQL let’s you change the indexes and columns of a table as much as you’d like. This isn’t possible if you’re using SQLite columnds and indexes, so nanoSQL actually stores the rows as JSON data in a single SQLite column (that way the schema can change as often as you’d like) and indexes are stored as a complete secondary table in SQLite.
    So in reality, nanoSQL “columns” and “indexes” cannot map onto SQLite “columns” and “indexes” to provide all the features nanoSQL does, so nanoSQL ends up using SQLite as a key-value store more or less.
    Chrizzly
    @Chris2011

    Ok, so what is the correct way now? My scenario: I created a cordova app with Vue, the vue cordova plugin and vuetify. I test my App on the Desktop browser and when I'm finish with everything I test it on my phone. For this I use NanoSQL to have a TEMP database which looks similar to the SQLite DB file that I have for my phone. On Desktop, I want to see the TEMP Database and on my phone, I want to use the real SQLite DB. So as you said, I just need to use createDatabse for Desktop with dummy tables and for the real world App I can use nSQL().connect with empty tables or is this really not possible?

    So for this, I need to have my queries doubled? One for Desktop to test my app and one for the Real world? @ClickSimply

    Chrizzly
    @Chris2011
    I have just simple CRUD operations, nothing more.
    Scott Lott
    @ClickSimply
    There’s a few things going on here…. I’m not sure what you would ever use dummy tables for. The actual tables should be in the createDatabase call in the app regardless of development or production mode.
    You can follow the steps on this page if you’re using Cordova: https://www.nanosql.io/adapters/sqlite-cordova.html#module-loader
    The plugin will automatically detect if you’re in a browser and use IndexedDB and use SQLite if you’re running on device.
    The tables need to always be in the createDatabase call so that NanoSQL knows the shape of the data in the tables and what tables are on device. It’s not SQLite where the schema is included in the database and follows it everywhere. In NanoSQL the schema is provided by you in the createDatabase call.
    Chrizzly
    @Chris2011

    Ok, I will test this. Thx. I only need the "dummy tables" for the browser to test. Because at the end it will be an app for Android and for this I have a dedicated sqlite file (my-app.db). And I just needed the tables for testing in the browser. It will never run there. But on my mobile phone it also showed me the dummy tables, not the correct ones from my db file. Neither for createDatabase nor connect. This is why I was wondering.

    But as I said, I will test what you told me and would like to come back to you to clarify when I was wrong. Thx :)

    LeftWild
    @LeftWild
    I'm having a problem deploying the app to android as the database is not being created, however in development mode it works on the emulator with no problems. I'm using cordova. I'm not asking for storage permissions, is it required?
    Scott Lott
    @ClickSimply
    Yes, you need storage permission. SQLite has to put the database somewhere. :)
    LeftWild
    @LeftWild
    Yeah i thought so too, but apparently SQLite Storage does that himself. After banging my head into the wall a few times and rebuilding the .apk without changing anything it worked, so I'm not sure what was wrong ahaha
    Thanks for the answer!
    Den-Gda
    @Den-Gda
    Hi, is it possible to select just an array of values, not an array of objects? for example in my graph subquery i have parameter select:["filedata"] and i get an array of objetcs [{filedata:'data1'}, {filedata:'data2'},...], how can i get just ['data1', 'data2'....]
    Scott Lott
    @ClickSimply
    There’s no way to do thtat built into the database, since you’re selecting essentially the keys you want.
    would be easy to do a .map(o => o.filedata) on the results to get this outcome.