How can you increase the library's usage and contributions?
Problem
You are limiting the library's usage and contributions by using an internal package and unexported functions.
dbgo uses a modified version of jet to interpret a Go file and output type-safe SQL.
Here are the issues experienced while implementing this functionality:
- Use of
internal: Using jet programmatically with an interpreter requires you to use functions which reference internal, when functions in an internal package cannot be referenced. So, the developer must rename the entire internal package to use jet with an interpreter.
- Unexported functions
genTemplate is unexported which requires the developer to inline a definition or export the function to use jet programmatically.
postgres package contains unexported functions which requires the developer to export them when using jet with an interpreter.
Implementation
You can increase the library's usage and contributions by replacing the internal package and exporting certain unexported functions.
https://github.com/switchupcb/jet/tree/dbgo is a version of jet which has these problems fixed for PostgreSQL functionality.
Implementation: Internal Usage
The solution to this problem requires further discussion among maintainers.
Implementation: Export Unexported Functions
You can approve the decision to export unexported fuinctions required for usage of jet in an interpreter (e.g., functions in import "github.com/go-jet/jet/v2/postgres") and I can create a pull request to solve this problem.
Here are example commits:
How can you increase the library's usage and contributions?
Problem
You are limiting the library's usage and contributions by using an
internalpackage and unexported functions.dbgouses a modified version ofjetto interpret a Go file and output type-safe SQL.Here are the issues experienced while implementing this functionality:
internal: Usingjetprogrammatically with an interpreter requires you to use functions which referenceinternal, when functions in aninternalpackage cannot be referenced. So, the developer must rename the entireinternalpackage to usejetwith an interpreter.genTemplateis unexported which requires the developer to inline a definition or export the function to usejetprogrammatically.postgrespackage contains unexported functions which requires the developer to export them when usingjetwith an interpreter.Implementation
You can increase the library's usage and contributions by replacing the
internalpackage and exporting certain unexported functions.https://github.com/switchupcb/jet/tree/dbgo is a version of
jetwhich has these problems fixed for PostgreSQL functionality.Implementation: Internal Usage
The solution to this problem requires further discussion among maintainers.
Implementation: Export Unexported Functions
You can approve the decision to export unexported fuinctions required for usage of
jetin an interpreter (e.g.,functions in import "github.com/go-jet/jet/v2/postgres") and I can create a pull request to solve this problem.Here are example commits: