Ensure configuration names, values, and settings accurately reflect their intended context and usage. Configuration mismatches can lead to runtime errors, incorrect behavior, and maintenance issues.
Key practices:
set: { configs: [...], role: ... }
instead of rlsConfig
for PostgreSQL transaction settings)Example of good configuration naming:
// Instead of context-specific naming
interface PgTransactionConfig {
rlsConfig?: { ... };
}
// Use generic, extensible naming
interface PgTransactionConfig {
set?: {
configs?: {
name: string;
value: string;
isLocal?: boolean;
}[];
role?: AnyPgRole;
};
}
This approach prevents configuration drift and makes code more maintainable when contexts change or expand.
Enter the URL of a public GitHub repository