by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Scott Lott
    @ClickSimply
    api.nanosql.io and nanosql.io cover nanoSQL V2, which is under the @nano-sql namespace in NPM.
    docs.nanosql.io covers nanoSQL V1, which is just nano-sql in npm
    that's why you're seeing a difference, the old data models is now under createTable
    If you wanted your queries to be typed, you could easily wrap them in a function.
    const mySelect: Promise<{id: string, name: string}[]> = () => nSQL("users").query("select", ["id", "name"]).exec() as any;
    Zakkari Abdelhakim
    @KingZee
    yep, that's what i'll probably do, thanks again for all the clarifications :) but i still think it'd be nice to have the .query() signature typed itself
    junsong
    @junsongsg_gitlab
    hello
    how to create db table with wildcard mode?
    so that i can save json doc directly
    Scott Lott
    @ClickSimply
    You’ll need a primary key column at the very least, but something like this would work:
    nSQL().query(“create table”, {
        name: “wildcard”,
        model: {
                "id:int": {pk: true, ai: true}, // pk = primary key, ai = auto increment
                “json:any": {},
        }
    }).then..
    // insert data
    nSQL(“wildcard”).query(“upsert”, {json: {…any data}}).exec().then...
    Suresh918
    @Suresh918
    Hi team,
    How can i write one to many relationship upsert query in nanosql2. Can you please provide me a example?
    how can i configure one to many relationship while creating table?
    Neville Franks
    @getclibu_twitter
    @ClickSimply Is there a way to restrict the columns returned by a 'select' query? ex. I don't want the entire row, just the id column.
    Scott Lott
    @ClickSimply
    Yeah: nSQL(“Table”).query(“select”, [“columns”, “to”, “get”]).exec()
    Neville Franks
    @getclibu_twitter
    @ClickSimply Thanks - I read that topic looking in the text, but missed the example code!
    Suresh918
    @Suresh918
    @ClickSimply Is there a way to export raw data with where condition. My requirement is like i want to export data periodically. So i don't want to export data which i already exported earlier. For that i want to keep one column for flag and by using that flag i want to export data. Can you please provide some suggestions on this. Thanks in advance
    Scott Lott
    @ClickSimply
    By export do you mean move the data out of the database? Another words get a copy of it then delete the copy inside the database?
    Suresh918
    @Suresh918
    @ClickSimply move the data out of the database using rawDump() method
    it's like exporting newly inserted data to a file
    by excluding already exported data earlier
    Pato Mtz
    @patowazhir
    Hey there!
    Has anyone else seen this?
    ClickSimply/Nano-SQL#192

    I'm getting this when trying to execute a simple drop

    await nSQL(this.tableName).query('drop').exec();

    Failed: Cannot set property 'count' of undefined
    at C:\Kinetic-ERP\projects\kinetic-erp-tester-e2e\node_modules\@nano-sql\core\src\query.ts:2134:70

    adamsbc
    @adamsbc
    Can I use nanosql with express?
    If so would it be like router.get('/', up.none(), (req,res) => { nsql("table").query('select'). Then(towards) ??
    *then (rows)
    Neville Franks
    @getclibu_twitter
    @adamsbc I can't see why not. nanoSQL is independent of other libraries and frameworks. Have you tried it and had a problem?
    @patowazhir No problems using 'drop' in my application. You could try rebuilding indexes.
    const result = await nSQL( this.dbTableName ).query( 'rebuild indexes' ).exec()
    Neville Franks
    @getclibu_twitter
    @patowazhir Ok I've had a closer look at my code and I'm not actually using 'drop' after all because it didn't (possibly still doesn't) delete indexes. I'm using 'delete' instead to delete all rows in the table.
    Martin Jonsson
    @Allam76
    Does anyone have an example model used with graph? I get object extensible error on the relation property which makes me believe my model setup is bad.
    That is the InanoSQLTableColumn.immutable is set to true.
    Martin Jonsson
    @Allam76
    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?