Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for tableware (0.25 sec)

  1. schema/schema.go

    		return s, s.err
    	}
    
    	modelValue := reflect.New(modelType)
    	tableName := namer.TableName(modelType.Name())
    	if tabler, ok := modelValue.Interface().(Tabler); ok {
    		tableName = tabler.TableName()
    	}
    	if tabler, ok := modelValue.Interface().(TablerWithNamer); ok {
    		tableName = tabler.TableName(namer)
    	}
    	if en, ok := namer.(embeddedNamer); ok {
    		tableName = en.Table
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  2. tests/table_test.go

    	}
    
    	AssertEqual(t, r.Statement.Vars, []interface{}{2, 4, 1, 3})
    }
    
    type UserWithTableNamer struct {
    	gorm.Model
    	Name string
    }
    
    func (UserWithTableNamer) TableName(namer schema.Namer) string {
    	return namer.TableName("user")
    }
    
    func TestTableWithNamer(t *testing.T) {
    	db, _ := gorm.Open(tests.DummyDialector{}, &gorm.Config{
    		NamingStrategy: schema.NamingStrategy{
    			TablePrefix: "t_",
    		},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  3. schema/schema_test.go

    		checkSchemaField(t, user, &fields[i], func(f *schema.Field) {
    			f.Creatable = true
    			f.Updatable = true
    			f.Readable = true
    		})
    	}
    }
    
    type CustomizeTable struct{}
    
    func (CustomizeTable) TableName() string {
    	return "customize"
    }
    
    func TestCustomizeTableName(t *testing.T) {
    	customize, err := schema.Parse(&CustomizeTable{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  4. schema/relationship_test.go

    	})
    }
    
    type Author struct {
    	gorm.Model
    }
    
    type Book struct {
    	gorm.Model
    	Author   Author
    	AuthorID uint
    }
    
    func (Book) TableName() string {
    	return "my_schema.a_very_very_very_very_very_very_very_very_long_table_name"
    }
    
    func TestParseConstraintNameWithSchemaQualifiedLongTableName(t *testing.T) {
    	s, err := schema.Parse(
    		&Book{},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  5. docs/zh/docs/tutorial/sql-databases.md

    从`database`(来自上面的`database.py`文件)导入`Base`。
    
    创建从它继承的类。
    
    这些类就是 SQLAlchemy 模型。
    
    ```Python hl_lines="4  7-8  18-19"
    {!../../../docs_src/sql_databases/sql_app/models.py!}
    ```
    
    这个`__tablename__`属性是用来告诉 SQLAlchemy 要在数据库中为每个模型使用的数据库表的名称。
    
    ### 创建模型属性/列
    
    现在创建所有模型(类)属性。
    
    这些属性中的每一个都代表其相应数据库表中的一列。
    
    我们使用`Column`来表示 SQLAlchemy 中的默认值。
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 27K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/sql-databases.md

    Create classes that inherit from it.
    
    These classes are the SQLAlchemy models.
    
    ```Python hl_lines="4  7-8  18-19"
    {!../../../docs_src/sql_databases/sql_app/models.py!}
    ```
    
    The `__tablename__` attribute tells SQLAlchemy the name of the table to use in the database for each of these models.
    
    ### Create model attributes/columns
    
    Now create all the model (class) attributes.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 29.6K bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/sql-databases.md

    🗄 `Base` ⚪️➡️ `database` (📁 `database.py` ⚪️➡️ 🔛).
    
    ✍ 🎓 👈 😖 ⚪️➡️ ⚫️.
    
    👫 🎓 🇸🇲 🏷.
    
    ```Python hl_lines="4  7-8  18-19"
    {!../../../docs_src/sql_databases/sql_app/models.py!}
    ```
    
    `__tablename__` 🔢 💬 🇸🇲 📛 🏓 ⚙️ 💽 🔠 👫 🏷.
    
    ### ✍ 🏷 🔢/🏓
    
    🔜 ✍ 🌐 🏷 (🎓) 🔢.
    
    🔠 👫 🔢 🎨 🏓 🚮 🔗 💽 🏓.
    
    👥 ⚙️ `Column` ⚪️➡️ 🇸🇲 🔢 💲.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 25.2K bytes
    - Viewed (1)
Back to top