Code Monkey home page Code Monkey logo

Comments (6)

paolochiodi avatar paolochiodi commented on August 22, 2024

@rjrodger see here for the tests https://github.com/rjrodger/seneca-store-test/blob/master/store-test.js#L457

from seneca-store-test.

rjrodger avatar rjrodger commented on August 22, 2024

no - this is not correct - is not allowed directly :)
a string in this position is always an opaque id

however, we can support { $native:"SELECT..." } as the query parameter - I think this is a valid use case, as it supports generating entity objects from a native query

note that this feature now applies to all stores, but is OPTIONAL - so we now introduce the idea of optional store features....

frameworks are fun

from seneca-store-test.

paolochiodi avatar paolochiodi commented on August 22, 2024

I'm afraid opaque id feature is not mentioned anywhere, I'll add tests for that.

I'll convert the the sql tests to use the native$ option. This will break backward compatibility on some of the stores.

About being optional to some of the stores, seneca-store-test is already constructed in way that makes easy to import and run only relevant tests (e.g.: basics, but not native sql)

from seneca-store-test.

paolochiodi avatar paolochiodi commented on August 22, 2024

@rjrodger I was wondering, is the "opaque id" supposed to work with the list$ command too?

from seneca-store-test.

paolochiodi avatar paolochiodi commented on August 22, 2024

@rjrodger Additional question: how is { native$: ... } supposed to work?

from seneca-store-test.

rjrodger avatar rjrodger commented on August 22, 2024

list$ should be able to take an array of ids as the query... so a degenerate case is a single id - so yes, opaque ids work for list$ too

{ native$:"SELECT * FROM foo" } should execute the query, and then construct -/-/foo entities using the result set.

from seneca-store-test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.