28 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
167
views
Ent ORM query with computed fields
I'm using Ent ORM and need help with a simple issue.
I run a query like:
SELECT id, first_name, last_name, first_name || ' ' || last_name AS fullname
FROM users
ORDER BY fullname
Since fullname ...
0
votes
0
answers
195
views
Issues with nltk's ne_chunk
I have been trying to use nltk's entity chunker, and tried different approaches but I keep getting the error:
LookupError Traceback (most recent call last)
...
...
1
vote
1
answer
489
views
Using Goose migration tool for running Golang migration when using Ent framework
I'm trying to create a POC for running Golang code migrations using goose. The issue is that I'm using Ent framework, which seems in compatible for a straight forward use with goose.
According to ...
1
vote
0
answers
103
views
ent how to update an entity based on queried entity
I'm new to ent orm, and I am trying to update an entity like this way:
user, _ := client.User.Query().Where(entuser.UserId(userId)).First()
user.Nickname = "new name"
user.Update().Save()
...
0
votes
1
answer
324
views
Unsigned smallint as primary key in Ent ORM for golang
I am trying to implement Ent ORM for my go project, but I encountered a problem while creating the database structure.
I have this first table which has an unsigned small int as primary key
package ...
1
vote
0
answers
103
views
Duplicate declaration in scheme using ENT ORM in GO
Using Go and ent ORM, I am creating a many-to-many relationship in which a source spec can have many tags, and the same tags can be used in any source spec.
Initially, I named my model tag ...
1
vote
0
answers
90
views
Ent schema declaration "Usage Of Edge Schema In Other Edge Types" but more indexes
I have two entity, first one is User:
// User holds the schema definition for the User entity.
type User struct {
ent.Schema
}
// Annotation of the User.
func (User) Annotations() []schema....
3
votes
1
answer
623
views
How to store PostGIS Point with entgo / pgx?
I'm having trouble saving a PostGIS point with entgo and pgx.
I try to use the pgtype.Point type from pgx, the schema looks like this:
// Fields of the Event.
func (EventSchema) Fields() []ent.Field {
...
1
vote
0
answers
802
views
How to build dynamic query with ent
I am trying to build a dynamic query with ent., because the searching fields may vary. The relation of the 3 table and SQL query are like below. The results should contains the fields from both ...
1
vote
1
answer
499
views
Updating updated_at Field for Related Records in Ent ORM
I'm working with the Ent ORM and I've defined two tables: user and password. The relationship is such that a user can have multiple passwords, but each password can be associated with only one user.
...
1
vote
0
answers
69
views
mysql 5.7 decimal precision lost after mysql operator '+'
ddl:
CREATE TABLE `tests` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`num` decimal(40,20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
sql:
...
2
votes
1
answer
708
views
How to make not to generate struct tag `json:"omitempty"`
I am using Go Ent for ORM in my Go server.
The problem is, whenever I generate codes by custom schema, it makes all the fields with omitempty tag.
For example, this is my ent/schema/user.go.
type User ...
1
vote
1
answer
840
views
Nested aggregation in Ent Query
How can I write this simple SQL statement using the code generated by Ent?
select max(t.sum_score) from
(select sum(score) as "sum_score"
...
1
vote
0
answers
440
views
ENTGQL go generate ./... UUID Error (error calling gqlIDType)
I have a problem. I'm trying to integrate entgo with gqlgen, and my go generate ./... command doesn't work. It throws an error below
running ent codegen: execute template "client": template: ...
4
votes
1
answer
3k
views
What is the difference between database/sql connection & pgx pool on golang?
I'm trying to use ent on golang backed with postgresql DB.
Current legacy code uses pgxpool for connection pool. But ent does not support pgx pool, and only support standard connection pool of ...