Giter Site home page Giter Site logo

Panic when inspecting pg about atlas HOT 7 CLOSED

ariga avatar ariga commented on August 26, 2024
Panic when inspecting pg

from atlas.

Comments (7)

bodinsamuel avatar bodinsamuel commented on August 26, 2024 3

I think I have reduced it down, but not sure why.

atlas schema apply -d "postgres://postgres:<pwd>@localhost:26432/postgres?sslmode=disable" -f main.hcl

# main.hcl
table "states" {
  schema = schema.public
  column "config_id" {
    null = false
    type = uuid
  }
  column "end_at" {
    null = true
    type = timestamp_without_time_zone(6)
  }
  foreign_key "states_id_fkey" {
    columns     = [table.states.column.config_id]
    ref_columns = [table.configs.column.id]
    on_update   = "NO ACTION"
    on_delete   = "CASCADE"
  }
  index "states_config_id_end_at" {
    on {
      column = table.states.column.config_id
    }
    on {
      desc   = true
      column = table.states.column.end_at
    }
    unique = true
  }
}

table "configs" {
  schema = schema.public
  column "id" {
    null = false
    type = uuid
  }
  column "name" {
    null = true
    type = character_varying(255)
  }
  primary_key {
    columns = [table.configs.column.id]
  }
}

schema "public" {
}

from atlas.

rotemtam avatar rotemtam commented on August 26, 2024 3

Thanks for reporting this @bodinsamuel ! Your example
was spot on in helping us triage the issue. Working on a fix now. Will update soon!

from atlas.

yonidavidson avatar yonidavidson commented on August 26, 2024

Hi @bodinsamuel 👋
Thanks for reporting this issue,
Is there a simple way for us to reproduce?
Thanks.

from atlas.

a8m avatar a8m commented on August 26, 2024

Hey @bodinsamuel, can you please check if you get this without the -w?

from atlas.

bodinsamuel avatar bodinsamuel commented on August 26, 2024

seems to work without the -w it output my schema correctly.
I guess my db has some unexpected keyword, but I can not share the schema since it's company property.

I tried to find a minimum schema to reproduce but seems "random" even though it's probably not ^^
I'll try to dig more

from atlas.

yonidavidson avatar yonidavidson commented on August 26, 2024

Hi @bodinsamuel ,
Thanks again for the hcl schema, it really helped us solve this issue and a fix can be found in our latest URL:

curl -LO https://release.ariga.io/atlas/atlas-darwin-amd64-latest

atlas CLI version

v0.3.3-92362a3e1558-canary

from atlas.

bodinsamuel avatar bodinsamuel commented on August 26, 2024

it works 🙏🏻
thanks !

from atlas.

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.