Giter VIP home page Giter VIP logo

Comments (5)

davetao avatar davetao commented on June 1, 2024

In the meantime, I know i can access the database directly via #26 to write my complex queries

#68 (comment) also mentions that we should be able to search via linked objects as well.

Do you have any approaches i should try in the meantime?

from vault.

tomxor avatar tomxor commented on June 1, 2024

What sort of ORM model are you using and does it allow table joins?

Vault uses its own implementation on top of SQLite. Link (relationships) resolution is a second step and the current state of the project is that queries do not contain information about linked resources.

Is it possible to query for content using a SQL statement?

You can run queries directly on Vault's db using Vault.getReadableDatabase() (as you've mentioned), though this will return a normal Cursor and will not go through the processing pipeline of the library.

This feature is currently not supported. The best thing you could do right now is make queries directly on the db in order to figure out which ids you're after, then use the library on a second query with an IN() clause providing the desired ids.

Once we figure out a plan for #68 this feature should be supported out-of-the-box and in a type-safe way.

from vault.

davetao avatar davetao commented on June 1, 2024

Thanks @tomxor I thought that would be the case and best approach.
Thank you.

from vault.

davetao avatar davetao commented on June 1, 2024

@tomxor just one more question in regards to this issue. I noticed that the database table names look nothing like the content type ids that they are referring to.

Is there a way to identify these tables other than hard coding the table name?

Would it be more useful to the end user if we just used the content type id used in contentful? That way we can make it easier to identify.

from vault.

tomxor avatar tomxor commented on June 1, 2024

The table name is an internal string created by the library, it is basically a static prefix combined with a normalized base64 string of the content type id. Right now you can access the generated code directly in order to pull the name of the table:

ModelHelper<Cat> helper = new Cat$$ModelHelper();
helper.getTableName(); // returns a string

I could possibly provide a convenience accessor for this property if that's of interest for anyone.

from vault.

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.