opendal icon indicating copy to clipboard operation
opendal copied to clipboard

feat: an DSN connection string format

Open flaneur2020 opened this issue 2 years ago • 1 comments

In the database drivers of different languages, they usually take a DSN format to connect different database backends.

Like the followings:

  • JDBC: jdbc:clickhouse://xxx.myclickhouse.intra.com:8123
  • Go SQL Driver: user:password@tcp(127.0.0.1:3306)/db?charset=utf8mb4

Maybe we could also get a DSN like format in opendal? The DSN format may have some benefits:

  • allows connecting to different providers in a unified connection format, every one speaks one URL-like string
  • easy to write config files, just one-liner instead of multiple parameters
  • easy to embed in program logic, likewise SELECT * FROM read_parquet("s3://mybucket.com/file.parquet?token_file=/var/token/access-token")

flaneur2020 avatar Feb 28 '23 02:02 flaneur2020

Nice concept. OpenDAL has been indecisive in adding this feature due to the instability of our builder's API. Furthermore, allowing users to write their own DSNs may exacerbate this issue. However, we will bring this matter to the forefront once we are confident enough to release OpenDAL 1.0.

Xuanwo avatar Feb 28 '23 02:02 Xuanwo

Replaced by https://github.com/apache/incubator-opendal/discussions/1494

Xuanwo avatar Apr 11 '23 08:04 Xuanwo