Replies: 5 comments 5 replies
-
it doesn't really bother me to have a prefix or not, to contribute to the discussion, after a quick search I see that most driver implementations use a prefix, although it seems a little verbose I think the prefix ends up helping, you can see in a quick look if the type refers to portgresql https://github.com/jasync-sql/jasync-sql maybe in the future we can have in dart a unified API for different drivers like python and crystal has https://peps.python.org/pep-0249/ |
Beta Was this translation helpful? Give feedback.
-
I think removing the For me, the important part would be to reduce the length of the commonly used types and methods - while keeping their names sane and descriptive. So maybe we should check if the v3 API has such names and if they tend to be on the longer end, we should consider dropping |
Beta Was this translation helpful? Give feedback.
-
After a lots of considerations, I think the most important part is to have a consistent class name structure. Right now Having checked a few Dart database driver's API, while reading the API I have found prefix-less class names better. It looks better on the dartdoc page to not start with the same character prefix in that side-list. @insinfo @simolus3 @osaxma what do you think? Should we put this to a vote? If I needed to vote, I'd put 0.6 without prefix, 0.4 with prefix. If somebody want to vote privately, please drop me an email. |
Beta Was this translation helpful? Give feedback.
-
Also to consider: with prefix we have |
Beta Was this translation helpful? Give feedback.
-
Note: I've published a prerelease version that dropped the Closing the issue for now, let's start new discussions on specific question separately (if there is any or if I went overboard with the naming changes). |
Beta Was this translation helpful? Give feedback.
-
At the moment, most types exported by the V3 API are prefixed with
Pg
to indicate that they belong to the postgres package. Since users can refer to them with named imports, we could also choose to drop that prefix (and renamePgDataType
to justDataType
, for example). Users who prefer the prefix could doimport 'package:postgres/postgres.dart' as pg;
and then usepg.DataType
explicitly.Personally, I have a slight preference towards the shorter form without the forced prefix: Users who want to be explicit can still chose to do that, but we're not forcing the name onto everyone.
But I've also heard from people (including people on the Dart team) who prefer the prefix. Using a prefix makes import management with auto-complete and the analysis server easier, since typing
Pg
shows all the relevant types. Without a prefix, there is no tool automatically adding thepg
named import and it might be harder to find public types from this package.I wanted to start this discussion to see if there are more aspects I might be overlooking. So maybe we can reach a consensus on whether the prefix should be dropped (from which there seems to be support?).
Beta Was this translation helpful? Give feedback.
All reactions