Giter Site home page Giter Site logo

PLANNING: sql-psi 1.0 about sql-psi HOT 2 CLOSED

AlecKazakova avatar AlecKazakova commented on July 26, 2024 8
PLANNING: sql-psi 1.0

from sql-psi.

Comments (2)

AlecKazakova avatar AlecKazakova commented on July 26, 2024 2

I think these are probably the next steps:

  • Iterate on grammar-kit-composer to support adding tokens and clean up the process of overriding rules
  • Figure out how to dynamically change the SQLDelight IntelliJ plugin's classpath (we'll need to do this for the IDE to understand dialects, since you'll specify the dialect in gradle and then the intellij plugin will somehow need to load that dialect into its classpath)
  • Create a new branch on sqldelight which tracks the sql-psi snapshot where we start working on pruning out the dialect stuff in sqldelight. We could probably just use sql-psi-dev for this.
    • I like this because it still enables other contributions to sqldelight master, and a potential 1.5.1 release if there are issues we need to fix.
    • We should start building the dialects in sqldelight so its easier to make changes both to sqldelight's compiler/runtime and the dialect and test them in tandem. Later on if we wanted to move them out (like if you want to host the postgres dialect veyndan) we can do that

i think since postgres is the dialect that has a bunch of bugs blocked by this we start with that so we can make sure we're moving in the right direction. I think we start by creating some new modules:

sqldelight
--drivers
----jdbc-driver
----postgres-driver (*new*)
--dialects (*new*)
----postgres-dialect (*new*)
--sqldelight-compiler
--sqldelight-gradle-plugin
--sqldelight-idea-plugin

and copy/paste the existing postgres folder from sql-psi into that module. I assume a bunch of things will go red about stuff being internal - we should just make all those things public and then we can target the snapshot build. Then from there we can start pulling the postgres-specific code in sqldelight-compiler into the postgres dialect.

I think using the gradle testkit integration tests in sqldelight-gradle-plugin would be a major pain in the ass, so I think we write integration tests by using composite builds:

sqldelight
--dialects
----postgres-dialect
------integration-tests
--------build.gradle
--------settings.gradle

in dialects/postgres-dialect/integration-tests/build.gradle

buildscript {
  dependencies {
    classpath "com.squareup.sqldelight:gradle-plugin"
  }
}

apply plugin: "com.squareup.sqldelight"

sqldelight {
  Database {
    dialect "com.squareup.sqldelight:postgres-dialect"
  }
}

in dialects/postgres-dialect/integration-tests/settings.gradle

includeBuild("../../../") {
  dependencySubstitution {
    substitute module("com.squareup.sqldelight:gradle-plugin") with project(":sqldelight-gradle-plugin")
    substitute module("com.squareup.sqldelight:postgres-dialect") with project(":dialects:postgres-dialect")
  }
}

I'm pretty confident in that approach making it the easiest to work on sqldelight 2.0, but I am less confident about the grammar/ide stuff - so those are going to be my initial focus once I switch back on to working on sqldelight.

from sql-psi.

AlecKazakova avatar AlecKazakova commented on July 26, 2024

The postgres-dialect will need to have a codegen component to it that ensures that all references to SqlDriver in the generated code are instead PostgreSqlJdbcDriver, and then we can start adding all the APIs to that driver (like getBoolean) and use them in the generated code.

from sql-psi.

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.