- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 25 for primary_key (0.06 sec)
-
tests/multi_primary_keys_test.go
package tests_test import ( "reflect" "sort" "testing" "gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) type Blog struct { ID uint `gorm:"primary_key"` Locale string `gorm:"primary_key"` Subject string Body string Tags []Tag `gorm:"many2many:blog_tags;"` SharedTags []Tag `gorm:"many2many:shared_blog_tags;ForeignKey:id;References:id"`
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 13.1K bytes - Viewed (0) -
schema/relationship_test.go
}, }) } func TestMany2ManyWithMultiPrimaryKeys(t *testing.T) { type Tag struct { ID uint `gorm:"primary_key"` Locale string `gorm:"primary_key"` Value string } type Blog struct { ID uint `gorm:"primary_key"` Locale string `gorm:"primary_key"` Subject string Body string Tags []Tag `gorm:"many2many:blog_tags;"`
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Aug 18 11:44:52 UTC 2025 - 26.5K bytes - Viewed (0) -
schema/field.go
} if prefix, ok := field.TagSettings["EMBEDDEDPREFIX"]; ok && ef.DBName != "" { ef.DBName = prefix + ef.DBName } if ef.PrimaryKey { if !utils.CheckTruth(ef.TagSettings["PRIMARYKEY"], ef.TagSettings["PRIMARY_KEY"]) { ef.PrimaryKey = false if val, ok := ef.TagSettings["AUTOINCREMENT"]; !ok || !utils.CheckTruth(val) { ef.AutoIncrement = false }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Aug 20 04:51:17 UTC 2025 - 32K bytes - Viewed (0) -
tests/preload_suits_test.go
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Jun 05 11:34:13 UTC 2025 - 30.4K bytes - Viewed (0) -
docs/pt/docs/tutorial/sql-databases.md
* `table=True` informa ao SQLModel que este é um *modelo de tabela*, ele deve representar uma **tabela** no banco de dados SQL, não é apenas um *modelo de dados* (como seria qualquer outra classe Pydantic comum). * `Field(primary_key=True)` informa ao SQLModel que o `id` é a **chave primária** no banco de dados SQL (você pode aprender mais sobre chaves primárias SQL na documentação do SQLModel).
Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Sun Oct 27 15:25:29 UTC 2024 - 15.8K bytes - Viewed (0) -
docs/ru/docs/tutorial/sql-databases.md
* `table=True` для SQLModel означает, что это *модель-таблица*, которая должна представлять **таблицу** в реляционной базе данных. Это не просто *модель данных* (в отличие от обычного класса в Pydantic). * `Field(primary_key=True)` для SQLModel означает, что поле `id` является первичным ключом в таблице базы данных (вы можете подробнее узнать о первичных ключах баз данных в документации по SQLModel).
Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Tue Dec 17 21:20:20 UTC 2024 - 25.7K bytes - Viewed (0) -
docs/es/docs/tutorial/sql-databases.md
* `table=True` le dice a SQLModel que este es un *modelo de tabla*, que debe representar una **tabla** en la base de datos SQL, no es solo un *modelo de datos* (como lo sería cualquier otra clase regular de Pydantic). * `Field(primary_key=True)` le dice a SQLModel que `id` es la **clave primaria** en la base de datos SQL (puedes aprender más sobre claves primarias de SQL en la documentación de SQLModel).
Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Mon Dec 30 18:26:57 UTC 2024 - 15.8K bytes - Viewed (0) -
docs/ko/docs/tutorial/sql-databases.md
몇 가지 차이점이 있습니다: * `table=True`는 SQLModel에 이 모델이 *테이블 모델*이며, 단순한 데이터 모델이 아니라 SQL 데이터베이스의 **테이블**을 나타낸다는 것을 알려줍니다. (다른 일반적인 Pydantic 클래스처럼) 단순한 *데이터 모델*이 아닙니다. * `Field(primary_key=True)`는 SQLModel에 `id`가 SQL 데이터베이스의 **기본 키**임을 알려줍니다 (SQL 기본 키에 대한 자세한 내용은 SQLModel 문서를 참고하세요). `int | None` 유형으로 설정하면, SQLModel은 해당 열이 SQL 데이터베이스에서 `INTEGER` 유형이며 `NULLABLE` 값이어야 한다는 것을 알 수 있습니다.
Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Tue Dec 24 16:14:29 UTC 2024 - 18K bytes - Viewed (0) -
docs/en/docs/tutorial/sql-databases.md
There are a few differences: * `table=True` tells SQLModel that this is a *table model*, it should represent a **table** in the SQL database, it's not just a *data model* (as would be any other regular Pydantic class). * `Field(primary_key=True)` tells SQLModel that the `id` is the **primary key** in the SQL database (you can learn more about SQL primary keys in the SQLModel docs).
Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Sun Aug 31 09:15:41 UTC 2025 - 15.4K bytes - Viewed (0) -
tests/update_test.go
Name string Token Token `gorm:"foreignKey:UserID"` } func (t *TokenOwner) BeforeSave(tx *gorm.DB) error { t.Name += "_name" return nil } type Token struct { UserID int `gorm:"primary_key"` Content string `gorm:"type:varchar(100)"` } func (t *Token) BeforeSave(tx *gorm.DB) error { t.Content += "_encrypted" return nil } func TestSaveWithHooks(t *testing.T) {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 30.4K bytes - Viewed (0)