Code Monkey home page Code Monkey logo

Comments (2)

twiddli avatar twiddli commented on September 27, 2024

Hello,
It was a bit of a confusing read but If i understand correctly then, yes, I think it should be possible.
I'm not an expert on SQL so I can't give you a definitive answer, however, I can tell you where I'd be looking.
Look into SQL Triggers http://www.sqlitetutorial.net/sqlite-trigger/.
I'm actually not sure of the limitations of SQL triggers but it might be possible to create two new columns in tags_mappings as you suggested, and then create a trigger to insert or update the text from from tags and namespaces into those two columns. I think this is what you want?

As for HP specifically, you could just periodically export the database to a HPDB file in the settings. This is just a JSON file containing all the gallery metadata in an easy to read manner. No need to fiddle with SQL.

from happypanda.

UnlimitedArk avatar UnlimitedArk commented on September 27, 2024

Thanks for the response, i'll look into triggers to see if it's the answer i seek.
Sorry for the confusing explanation, it's a bit hard trying to explain that i need the new columns to be filled with the right text values correlated to the IDs in those rows.

Dunno if it makes it a bit easier to understand, or even harder, but here's an example of what i'm trying to accomplish.
example 2

In this example, most of the rows contain 22 as namespace id, thus the new column "namespace" takes the data from the namespaces table (where the column shows that 22=artist) and writes "artist" as a result on every row until namespace_id 3 ;
same with the new "tag" table, every id gets the correct text value and is an easier read than having just IDs withouth knowing what they stand for and having to search manually one by one.

Thanks for the help anyway, i'm thankful that happypanda doesn't need this kind of operations to read the contents of its database.

from happypanda.

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.