Giter Site home page Giter Site logo

Computeds in SQL adapter about edgedb HOT 4 OPEN

aljazerzen avatar aljazerzen commented on May 29, 2024 1
Computeds in SQL adapter

from edgedb.

Comments (4)

jnak avatar jnak commented on May 29, 2024 1

Thanks for continuing the discussion!

@jnak Can I ask, which tool are you using for reverse-ETL? Is there an option to include auto-generated columns? And views?

We're not yet using a proper reverse-ETL tool, as we've purposefully pushed back on investing too much into our warehouse for now. However, we're currently using services such as Metabase and Customer IO that query EdgeDB via the SQL interface. We'll be looking at tools such as FiveTran or Airbyte when we're ready to invest to our warehouse.

Current plan is to expose single computeds as GENERATED columns and multi computeds as CREATE VIEW X (source uuid, target computed_type). This is the plan because pg_dump does not dump GENERATED columns and views, but it would be useless if they were unavailable to ETL tools.

This is super exciting! I can't wait to use it. What's the timeline there?

Tangantially-related, are you planning to allow computed fields to be materialized/generated in EdgeDB? That would be huge! We don't need it yet, but it would be amazing to know that, at some point, we could speed up slow computed values by materializing them :)

from edgedb.

aljazerzen avatar aljazerzen commented on May 29, 2024

@jnak Can I ask, which tool are you using for reverse-ETL? Is there an option to include auto-generated columns? And views?

Current plan is to expose single computeds as GENERATED columns and multi computeds as CREATE VIEW X (source uuid, target computed_type). This is the plan because pg_dump does not dump GENERATED columns and views, but it would be useless if they were unavailable to ETL tools.

An alternative approach would be to have a SET variable that enables the computed columns as regular columns and also the table for multi computeds.

from edgedb.

aljazerzen avatar aljazerzen commented on May 29, 2024

What's the timeline there?

This is hard to say, as I have a different task before this one which has a lot of unknowns with it. The worst-worst scenario would be 6.0, which will release end of June.

Are you planning to allow computed fields to be materialized/generated in EdgeDB?

They will definitely be computed during query-time. We don't want to unnecessary space. If you'd want things materialized, you could use regular pointers with mutation rewrites to update the value on inserts and updates.

from edgedb.

jnak avatar jnak commented on May 29, 2024

This is hard to say, as I have a different task before this one which has a lot of unknowns with it. The worst-worst scenario would be 6.0, which will release end of June.

Exciting!

They will definitely be computed during query-time. We don't want to unnecessary space. If you'd want things materialized, you could use regular pointers with mutation rewrites to update the value on inserts and updates.

Yeah, I know it's possible with triggers, but then it can get tricky to write it in the first place if the computed field queries multiple types. Also, the logic is no longer encapsulated in one place, which increases the likelihood that some refactoring will introduce an unwanted consistency bug. It would be nice if the compiler could take care of that automatically for us. But that's a non-trivial project to handle all the edge cases.

from edgedb.

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.