Giter Site home page Giter Site logo

Comments (6)

a8m avatar a8m commented on July 28, 2024

Hey @calvin2021y ๐Ÿ‘‹๐Ÿป

Yes, please check out this comment #1034 (comment):

As the command accepts a URL, the standard way for dealing with odd characters is using URL encoding, see IETF RFC 1738, (see section 2.2) which defines URLs formally. I don't think Atlas should encode the URL for the user as this is a one-time operation (e.g doesn't change unless the password itself changes).

from atlas.

calvin2021y avatar calvin2021y commented on July 28, 2024

even so, add a arguments to accept raw password will be much easy for users.

from atlas.

a8m avatar a8m commented on July 28, 2024

Agree. Thatโ€™s why we added urlescape to Atlas configuration.

from atlas.

calvin2021y avatar calvin2021y commented on July 28, 2024

Can i use this from bash command without change code ?

from atlas.

a8m avatar a8m commented on July 28, 2024

Create an atlas.hcl file and use the urlescape function. The URL (of an actual database) should not be stored in the file but injected as a variable or read from some secrets store (Atlas supports this too). For example:

variable "url" {
  type     = string
  default = "<local url"> // Can also be defined as: getenv("DATABASE_URL")
}

env "mysql" {
  url  = urlescape(var.url)
  src = "file://test.hcl"
  # In case you use and want to define a dev-database.
  dev = "docker://mysql/8/dev"
}
atlas schema apply \
  --env mysql \
  --var "url=mysql://test:+ysT*Au-83b57X9^t2@mysql:3306/test"

from atlas.

calvin2021y avatar calvin2021y commented on July 28, 2024

thanks for the tips, after some research I find this tools work suit me need.

trurl --url mysql://MYSQL_HOST --set port=$MYSQL_PORT --set user=$MYSQL_USER --set password=$MYSQL_PWD

https://github.com/curl/trurl

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.