Comments (4)
Hi @otto-nordander-yubico, I don't think we can do much in jet regarding this limit. Identifier length limit is purely postgres config. And according to google, you can either recompile "compile the PostgreSQL software from source and increase that limit" or "use shorter names". Since the database returns just a NOTICE, we can't report an error. Error is being silenced in db.
from jet.
Hi @otto-nordander-yubico, I don't think we can do much in jet regarding this limit. Identifier length limit is purely postgres config. And according to google, you can either recompile "compile the PostgreSQL software from source and increase that limit" or "use shorter names". Since the database returns just a NOTICE, we can't report an error. Error is being silenced in db.
I see, I didn't know that it was configurable. It seems that the default is 63 characters, would it be possible to make it configurable in Jet as well so that it would truncate too?
Or perhaps you don't want to add such DB specific configuration.
from jet.
Identifier length limit is postgres compile time config. Meaning to change the config you need to download postgres source code, change the config and compile postgres your self. This obviously is not a recommended approach.
IMO you can either make you database identifiers smaller or you can re-alias every column manually:
stmt := SELECT(
tables.ThisIsAnAwkwardlyLongTableName.ThisIsAVeryLongIdentifier.AS("short_table_name.short_ident"),
).FROM(tables.ThisIsAnAwkwardlyLongTableName)
type ShortTableName struct {
ShortIdent int
}
var dest ShortTableName
err := stmt.Query(db, &dest)
from jet.
Identifier length limit is postgres compile time config. Meaning to change the config you need to download postgres source code, change the config and compile postgres your self. This obviously is not a recommended approach.
IMO you can either make you database identifiers smaller or you can re-alias every column manually:
stmt := SELECT( tables.ThisIsAnAwkwardlyLongTableName.ThisIsAVeryLongIdentifier.AS("short_table_name.short_ident"), ).FROM(tables.ThisIsAnAwkwardlyLongTableName) type ShortTableName struct { ShortIdent int } var dest ShortTableName err := stmt.Query(db, &dest)
Yeah that's very cumbersome and not feasible for me.
I'll look into trying to scan for such occurrences on our end instead.
Thanks for the swift responses, I guess we can close this now.
from jet.
Related Issues (20)
- Add support for prepared statement HOT 14
- MySQL: A utility function for comparision of UUID fields HOT 2
- Issues with Query Result Mapper HOT 5
- Alias is broken or I'm doing something wrong HOT 7
- Multiple dynamic WHERE statements HOT 1
- Small typo in wiki HOT 1
- Postgis geography type shows as `postgres.ColumnString` HOT 3
- More convenient way to implement raw/custom operators HOT 5
- Support `WHERE "column" = ANY($1)` HOT 7
- Should return value with return type HOT 1
- Support `WHERE()` on `INSERT ON CONFLICT DO UPDATE` HOT 2
- Support for SQLite FTS5? HOT 2
- Unsupported sql column for the array in postgres HOT 2
- Incorrect Docs: Generator Customization references invalid interfaces HOT 5
- `Generate` function signature doesn't match documentation HOT 1
- Is there a way to make generic db functions for all models/tables? HOT 1
- Sqlite GENERATE columns, but being used in INSERT HOT 4
- Support for keyword arguments to functions HOT 3
- Support for filtered aggregations HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jet.