Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create component which will create an identifier for Postgres objects like functions, policies, and constraints. #48

Open
starnowski opened this issue Apr 18, 2020 · 1 comment

Comments

@starnowski
Copy link
Owner

starnowski commented Apr 18, 2020

Create component which will create identifier for postgres objects like functions, policies and constraints.

PostgresIdentifier.produce(String... args)

Example:

producer.produce("is", "user_id", "from", "tenat") == "is_user_id_from_tenant"

The component should truncate the value to maximum length available in Postgres (by default it is 63 characters).

IMPORTANT!
Create a component that will be able to check the value of NAMEDATALEN and if it's valid with the maximum value set in component responsible for identifier generation.

  • In case when the value is higher than the minimum value then print warning.
  • In case when the value is lower than user in component throw exception.

https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

https://www.postgresql.org/message-id/20041101092011.GA26912%40svana.org

https://til.hashrocket.com/posts/8f87c65a0a-postgresqls-max-identifier-length-is-63-bytes

@starnowski
Copy link
Owner Author

Consider adding the interface (defined just like below), implemented by all the SQLDefinition objects.

interface HasSQLObjectsWithNames
{

List<SQLObjectName> getSQLObjectNames();

}

SQLObjectName
{
String getName();

String getSchema();

}

@starnowski starnowski added this to the r-0.1 milestone Aug 2, 2020
@starnowski starnowski modified the milestones: r-0.1, r-0.2 Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant