• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang fizz.AString函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/markbates/pop/fizz.AString函数的典型用法代码示例。如果您正苦于以下问题:Golang AString函数的具体用法?Golang AString怎么用?Golang AString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了AString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: Test_SQLite_RenameIndex

func (p *SQLiteSuite) Test_SQLite_RenameIndex() {
	r := p.Require()

	ddl := `DROP INDEX IF EXISTS "old_ix";
CREATE UNIQUE INDEX "new_ix" ON "users" (id, created_at);`

	schema.schema["users"] = &fizz.Table{
		Name: "users",
		Columns: []fizz.Column{
			fizz.ID_COL,
			fizz.CREATED_COL,
			fizz.UPDATED_COL,
		},
		Indexes: []fizz.Index{
			{
				Name:    "old_ix",
				Columns: []string{"id", "created_at"},
				Unique:  true,
			},
		},
	}

	res, _ := fizz.AString(`rename_index("users", "old_ix", "new_ix")`, sqt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:25,代码来源:sqlite_test.go


示例2: Test_MySQL_AddIndex_CustomName

func (p *MySQLSuite) Test_MySQL_AddIndex_CustomName() {
	r := p.Require()
	ddl := `CREATE INDEX email_index ON users (email);`

	res, _ := fizz.AString(`add_index("users", "email", {"name": "email_index"})`, myt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:mysql_test.go


示例3: Test_MySQL_DropIndex

func (p *MySQLSuite) Test_MySQL_DropIndex() {
	r := p.Require()
	ddl := `DROP INDEX email_idx ON users;`

	res, _ := fizz.AString(`drop_index("users", "email_idx")`, myt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:mysql_test.go


示例4: Test_MySQL_AddIndex_Unique

func (p *MySQLSuite) Test_MySQL_AddIndex_Unique() {
	r := p.Require()
	ddl := `CREATE UNIQUE INDEX users_email_idx ON users (email);`

	res, _ := fizz.AString(`add_index("users", "email", {"unique": true})`, myt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:mysql_test.go


示例5: Test_MySQL_CreateTable

func (p *MySQLSuite) Test_MySQL_CreateTable() {
	r := p.Require()
	ddl := `CREATE TABLE users (
id integer NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
first_name VARCHAR (255) NOT NULL,
last_name VARCHAR (255) NOT NULL,
email VARCHAR (20) NOT NULL,
permissions text,
age integer DEFAULT 40
) ENGINE=InnoDB;`

	res, _ := fizz.AString(`
	create_table("users", func(t) {
		t.Column("first_name", "string", {})
		t.Column("last_name", "string", {})
		t.Column("email", "string", {"size":20})
		t.Column("permissions", "text", {"null": true})
		t.Column("age", "integer", {"null": true, "default": 40})
	})
	`, myt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:25,代码来源:mysql_test.go


示例6: Test_Postgres_DropIndex

func (p *PostgreSQLSuite) Test_Postgres_DropIndex() {
	r := p.Require()
	ddl := `DROP INDEX "my_idx";`

	res, _ := fizz.AString(`drop_index("users", "my_idx")`, pgt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:postgres_test.go


示例7: Test_SQLite_DropIndex

func (p *SQLiteSuite) Test_SQLite_DropIndex() {
	r := p.Require()
	ddl := `DROP INDEX IF EXISTS "my_idx";`

	res, _ := fizz.AString(`drop_index("my_table", "my_idx")`, sqt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:sqlite_test.go


示例8: Test_MySQL_AddIndex_MultiColumn

func (p *MySQLSuite) Test_MySQL_AddIndex_MultiColumn() {
	r := p.Require()
	ddl := `CREATE INDEX users_id_email_idx ON users (id, email);`

	res, _ := fizz.AString(`add_index("users", ["id", "email"], {})`, myt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:mysql_test.go


示例9: Test_SQLite_AddIndex_MultiColumn

func (p *SQLiteSuite) Test_SQLite_AddIndex_MultiColumn() {
	r := p.Require()
	ddl := `CREATE INDEX "table_name_col1_col2_col3_idx" ON "table_name" (col1, col2, col3);`

	res, _ := fizz.AString(`add_index("table_name", ["col1", "col2", "col3"], {})`, sqt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:sqlite_test.go


示例10: Test_SQLite_AddIndex_CustomName

func (p *SQLiteSuite) Test_SQLite_AddIndex_CustomName() {
	r := p.Require()
	ddl := `CREATE INDEX "custom_name" ON "table_name" (column_name);`

	res, _ := fizz.AString(`add_index("table_name", "column_name", {"name": "custom_name"})`, sqt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:sqlite_test.go


示例11: Test_SQLite_AddIndex_Unique

func (p *SQLiteSuite) Test_SQLite_AddIndex_Unique() {
	r := p.Require()
	ddl := `CREATE UNIQUE INDEX "table_name_column_name_idx" ON "table_name" (column_name);`

	res, _ := fizz.AString(`add_index("table_name", "column_name", {"unique": true})`, sqt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:sqlite_test.go


示例12: Test_Postgres_AddIndex

func (p *PostgreSQLSuite) Test_Postgres_AddIndex() {
	r := p.Require()
	ddl := `CREATE INDEX "table_name_column_name_idx" ON "table_name" (column_name);`

	res, _ := fizz.AString(`add_index("table_name", "column_name", {})`, pgt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:postgres_test.go


示例13: Test_Postgres_RenameColumn

func (p *PostgreSQLSuite) Test_Postgres_RenameColumn() {
	r := p.Require()
	ddl := `ALTER TABLE "table_name" RENAME COLUMN "old_column" TO "new_column";`

	res, _ := fizz.AString(`rename_column("table_name", "old_column", "new_column")`, pgt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:postgres_test.go


示例14: Test_MySQL_RenameColumn

func (p *MySQLSuite) Test_MySQL_RenameColumn() {
	r := p.Require()
	ddl := `ALTER TABLE users CHANGE email email_address varchar(50) NOT NULL DEFAULT '[email protected]';`

	res, _ := fizz.AString(`rename_column("users", "email", "email_address")`, myt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:7,代码来源:mysql_test.go


示例15: Test_MySQL_DropColumn

func (p *MySQLSuite) Test_MySQL_DropColumn() {
	r := p.Require()
	ddl := `ALTER TABLE users DROP COLUMN mycolumn;`

	res, _ := fizz.AString(`drop_column("users", "mycolumn")`, myt)

	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:8,代码来源:mysql_test.go


示例16: Test_MySQL_RenameIndex

func (p *MySQLSuite) Test_MySQL_RenameIndex() {
	r := p.Require()

	ddl := `ALTER TABLE users RENAME INDEX email_idx TO email_address_ix;`

	res, _ := fizz.AString(`rename_index("users", "email_idx", "email_address_ix")`, myt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:8,代码来源:mysql_test.go


示例17: Test_MySQL_DropTable

func (p *MySQLSuite) Test_MySQL_DropTable() {
	r := p.Require()

	ddl := `DROP TABLE "users";`

	res, _ := fizz.AString(`drop_table("users")`, myt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:8,代码来源:mysql_test.go


示例18: Test_SQLite_DropTable

func (p *SQLiteSuite) Test_SQLite_DropTable() {
	r := p.Require()

	ddl := `DROP TABLE "users";`

	res, _ := fizz.AString(`drop_table("users")`, sqt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:8,代码来源:sqlite_test.go


示例19: Test_Postgres_DropColumn

func (p *PostgreSQLSuite) Test_Postgres_DropColumn() {
	r := p.Require()
	ddl := `ALTER TABLE "table_name" DROP COLUMN "column_name";`

	res, _ := fizz.AString(`drop_column("table_name", "column_name")`, pgt)

	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:8,代码来源:postgres_test.go


示例20: Test_Postgres_DropTable

func (p *PostgreSQLSuite) Test_Postgres_DropTable() {
	r := p.Require()

	ddl := `DROP TABLE "users";`

	res, _ := fizz.AString(`drop_table("users")`, pgt)
	r.Equal(ddl, res)
}
开发者ID:markbates,项目名称:pop,代码行数:8,代码来源:postgres_test.go



注:本文中的github.com/markbates/pop/fizz.AString函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang container.Container类代码示例发布时间:2022-05-23
下一篇:
Golang gothic.CompleteUserAuth函数代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap