Coder Social home page Coder Social logo

Comments (6)

koskimas avatar koskimas commented on May 12, 2024 5

Generated columns are now also supported in master. Not released yet. You can use it like this:

db.schema
  .createTable('person')
  .addColumn('full_name', 'varchar(255)',
    (col) => col.generatedAlwaysAs("concat(first_name, ' ', last_name)").stored()
  )
  .execute()

from kysely.

koskimas avatar koskimas commented on May 12, 2024 4

0.9.9 version now has createView and dropView methods in the schema module.

from kysely.

AzSiAz avatar AzSiAz commented on May 12, 2024 2

Thanks for those 3 extremely quick update, I will try to test these new migration as soon as I can

To be honest I had to replace some prisma query for more optimized query and working with Kysely as been fantastic so far, so thank you ☺️

from kysely.

koskimas avatar koskimas commented on May 12, 2024 1

0.10.0 also supports materialized views. There's a couple of breaking changes in 0.10.0 https://github.com/koskimas/kysely/releases

from kysely.

koskimas avatar koskimas commented on May 12, 2024

You can always run raw queries in migrations using db.raw. Views could be one of the next things to add. I've never used generated columns or heard anyone using them. But I'll see if it's easy to add support for those too.

from kysely.

AzSiAz avatar AzSiAz commented on May 12, 2024

True, I could always create the table and add a manual alter table after πŸ€”

Generated column are quite new (PG 12) and to be honest the only time I saw them used is here

from kysely.

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.