7 questions
import( github.com/jinzhu/gorm _github.com/mattn/go-sqlite3)typeUnivNormalTimeTable structure { Id int`json: id` Hour int `json: hour` Minute int`json: minute` DayOfTheWeek string `json: day_of_the_we...
I would like to save the following structures in the form of multiple teachers in one LectureInfo.typeLectureInfoct{ gorm.Model Name string Teachers[] Teacher `gorm: foreignKey:LectureID`}typeTeacher ...
db.Preload(Orders).Preload(Profile).Preload(Role).Find(&users)//// SELECT* FROM users;//// SELECT* FROM orders WHERE user_id IN (1, 2, 3, 4); // has many//// SELECT* FROM profiles WHERE user_id IN...
I used the postgreSQL LIKE statement in the ORM called gorm in the Go language, but somehow I can't get the data.The model is assumed to be: type Model structure { ID int Name string Phonetic string...
Only certain table JOINs fail in PostgreSQLWe are developing API servers in Go language and PostgreSQL.At that time, the following error occurs only when the user table is used as JOIN.Starting from t...
I am currently making a simple API using GAE+CloudSQL.We tried to implement an API that could retrieve all DB data and created the following code:package mainimport( encoding/json fmt _github.com/go-s...
I'd like to place multiple unique constraints on a single column in Gorm.typeObject structure{ Z string `gorm: unique_index:unique_a;unique_index:unique_b` A string `gorm: unique_index:unique_a` B str...
© 2024 OneMinuteCode. All rights reserved.