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

Golang v2.DBDrop函数代码示例

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

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



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

示例1: SetupTest

func (suite *MutationUpdateSuite) SetupTest() {
	suite.T().Log("Setting up MutationUpdateSuite")
	// Use imports to prevent errors
	_ = time.Time{}
	_ = compare.AnythingIsFine

	session, err := r.Connect(r.ConnectOpts{
		Address: url,
	})
	suite.Require().NoError(err, "Error returned when connecting to server")
	suite.session = session

	r.DBDrop("test").Exec(suite.session)
	err = r.DBCreate("test").Exec(suite.session)
	suite.Require().NoError(err)
	err = r.DB("test").Wait().Exec(suite.session)
	suite.Require().NoError(err)

	r.DB("test").TableDrop("tbl").Exec(suite.session)
	err = r.DB("test").TableCreate("tbl").Exec(suite.session)
	suite.Require().NoError(err)
	err = r.DB("test").Table("tbl").Wait().Exec(suite.session)
	suite.Require().NoError(err)
	r.DB("test").TableDrop("tbl2").Exec(suite.session)
	err = r.DB("test").TableCreate("tbl2").Exec(suite.session)
	suite.Require().NoError(err)
	err = r.DB("test").Table("tbl2").Wait().Exec(suite.session)
	suite.Require().NoError(err)
}
开发者ID:freedmand,项目名称:doc.vu,代码行数:29,代码来源:reql_mutation_update_test.go


示例2: TearDownSuite

func (suite *MathLogicLogicSuite) TearDownSuite() {
	suite.T().Log("Tearing down MathLogicLogicSuite")

	if suite.session != nil {
		r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session)
		r.DBDrop("test").Exec(suite.session)

		suite.session.Close()
	}
}
开发者ID:freedmand,项目名称:doc.vu,代码行数:10,代码来源:reql_math_logic_logic_test.go


示例3: TearDownSuite

func (suite *GeoIntersectionInclusionSuite) TearDownSuite() {
	suite.T().Log("Tearing down GeoIntersectionInclusionSuite")

	if suite.session != nil {
		r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session)
		r.DBDrop("test").Exec(suite.session)

		suite.session.Close()
	}
}
开发者ID:freedmand,项目名称:doc.vu,代码行数:10,代码来源:reql_geo_intersection_inclusion_test.go


示例4: TearDownSuite

func (suite *PolymorphismSuite) TearDownSuite() {
	suite.T().Log("Tearing down PolymorphismSuite")

	if suite.session != nil {
		r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session)
		r.DB("test").TableDrop("tbl").Exec(suite.session)
		r.DBDrop("test").Exec(suite.session)

		suite.session.Close()
	}
}
开发者ID:freedmand,项目名称:doc.vu,代码行数:11,代码来源:reql_polymorphism_test.go


示例5: TearDownSuite

func (suite *ChangefeedsIncludeStatesSuite) TearDownSuite() {
	suite.T().Log("Tearing down ChangefeedsIncludeStatesSuite")

	if suite.session != nil {
		r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session)
		r.DB("test").TableDrop("tbl").Exec(suite.session)
		r.DBDrop("test").Exec(suite.session)

		suite.session.Close()
	}
}
开发者ID:freedmand,项目名称:doc.vu,代码行数:11,代码来源:reql_changefeeds_include_states_test.go


示例6: TearDownSuite

func (suite *SindexNullsinstringsSuite) TearDownSuite() {
	suite.T().Log("Tearing down SindexNullsinstringsSuite")

	if suite.session != nil {
		r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session)
		r.DB("test").TableDrop("tbl").Exec(suite.session)
		r.DBDrop("test").Exec(suite.session)

		suite.session.Close()
	}
}
开发者ID:freedmand,项目名称:doc.vu,代码行数:11,代码来源:reql_sindex_nullsinstrings_test.go


示例7: TearDownSuite

func (suite *MutationAtomicGetSetSuite) TearDownSuite() {
	suite.T().Log("Tearing down MutationAtomicGetSetSuite")

	if suite.session != nil {
		r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session)
		r.DB("test").TableDrop("tbl").Exec(suite.session)
		r.DBDrop("test").Exec(suite.session)

		suite.session.Close()
	}
}
开发者ID:freedmand,项目名称:doc.vu,代码行数:11,代码来源:reql_mutation_atomic_get_set_test.go


示例8: TearDownSuite

func (suite *TransformUnorderedMapSuite) TearDownSuite() {
	suite.T().Log("Tearing down TransformUnorderedMapSuite")

	if suite.session != nil {
		r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session)
		r.DB("test").TableDrop("even").Exec(suite.session)
		r.DB("test").TableDrop("odd").Exec(suite.session)
		r.DB("test").TableDrop("odd2").Exec(suite.session)
		r.DBDrop("test").Exec(suite.session)

		suite.session.Close()
	}
}
开发者ID:freedmand,项目名称:doc.vu,代码行数:13,代码来源:reql_transform_unordered_map_test.go


示例9: TearDownSuite

func (suite *JoinsSuite) TearDownSuite() {
	suite.T().Log("Tearing down JoinsSuite")

	if suite.session != nil {
		r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session)
		r.DB("test").TableDrop("messages").Exec(suite.session)
		r.DB("test").TableDrop("otbl").Exec(suite.session)
		r.DB("test").TableDrop("otbl2").Exec(suite.session)
		r.DB("test").TableDrop("receivers").Exec(suite.session)
		r.DB("test").TableDrop("senders").Exec(suite.session)
		r.DB("test").TableDrop("tbl").Exec(suite.session)
		r.DB("test").TableDrop("tbl2").Exec(suite.session)
		r.DBDrop("test").Exec(suite.session)

		suite.session.Close()
	}
}
开发者ID:freedmand,项目名称:doc.vu,代码行数:17,代码来源:reql_joins_test.go


示例10: TestCases


//.........这里部分代码省略.........

		suite.T().Log("About to run line #333: r.DB('rethinkdb').Table('table_config').Filter(map[interface{}]interface{}{'name': 'testA', }).Nth(0).Eq(r.Table('testA').Config())")

		runAndAssert(suite.Suite, expected_, r.DB("rethinkdb").Table("table_config").Filter(map[interface{}]interface{}{"name": "testA"}).Nth(0).Eq(r.Table("testA").Config()), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #333")
	}

	{
		// meta/table.yaml line #336
		/* True */
		var expected_ bool = true
		/* r.db('rethinkdb').table('table_status').filter({'name':'testA'}).nth(0).eq(r.table('testA').status()) */

		suite.T().Log("About to run line #336: r.DB('rethinkdb').Table('table_status').Filter(map[interface{}]interface{}{'name': 'testA', }).Nth(0).Eq(r.Table('testA').Status())")

		runAndAssert(suite.Suite, expected_, r.DB("rethinkdb").Table("table_status").Filter(map[interface{}]interface{}{"name": "testA"}).Nth(0).Eq(r.Table("testA").Status()), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #336")
	}

	{
		// meta/table.yaml line #339
		/* uuid() */
		var expected_ compare.Regex = compare.IsUUID()
		/* r.db('rethinkdb').table('table_config', identifier_format='uuid').nth(0)["db"] */

		suite.T().Log("About to run line #339: r.DB('rethinkdb').Table('table_config').OptArgs(r.TableOpts{IdentifierFormat: 'uuid', }).Nth(0).AtIndex('db')")

		runAndAssert(suite.Suite, expected_, r.DB("rethinkdb").Table("table_config").OptArgs(r.TableOpts{IdentifierFormat: "uuid"}).Nth(0).AtIndex("db"), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #339")
	}

	{
		// meta/table.yaml line #344
		/* 0 */
		var expected_ int = 0
		/* r.table('testA', identifier_format='uuid').count() */

		suite.T().Log("About to run line #344: r.Table('testA').OptArgs(r.TableOpts{IdentifierFormat: 'uuid', }).Count()")

		runAndAssert(suite.Suite, expected_, r.Table("testA").OptArgs(r.TableOpts{IdentifierFormat: "uuid"}).Count(), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #344")
	}

	{
		// meta/table.yaml line #358
		/* partial({'tables_dropped':1}) */
		var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"tables_dropped": 1})
		/* db.table_drop('testA') */

		suite.T().Log("About to run line #358: db.TableDrop('testA')")

		runAndAssert(suite.Suite, expected_, db.TableDrop("testA"), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #358")
	}

	{
		// meta/table.yaml line #361
		/* partial({'tables_dropped':1}) */
		var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"tables_dropped": 1})
		/* db.table_drop('testB') */

		suite.T().Log("About to run line #361: db.TableDrop('testB')")

		runAndAssert(suite.Suite, expected_, db.TableDrop("testB"), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #361")
	}

	{
		// meta/table.yaml line #364
		/* partial({'dbs_dropped':1,'tables_dropped':1}) */
		var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"dbs_dropped": 1, "tables_dropped": 1})
		/* r.db_drop('test2') */

		suite.T().Log("About to run line #364: r.DBDrop('test2')")

		runAndAssert(suite.Suite, expected_, r.DBDrop("test2"), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #364")
	}
}
开发者ID:freedmand,项目名称:doc.vu,代码行数:101,代码来源:reql_meta_table_test.go


示例11: TestCases

func (suite *MetaDbsSuite) TestCases() {
	suite.T().Log("Running MetaDbsSuite: Tests meta queries for databases")

	{
		// meta/dbs.yaml line #6
		/* bag(['rethinkdb', 'test']) */
		var expected_ compare.Expected = compare.UnorderedMatch([]interface{}{"rethinkdb", "test"})
		/* r.db_list() */

		suite.T().Log("About to run line #6: r.DBList()")

		runAndAssert(suite.Suite, expected_, r.DBList(), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #6")
	}

	{
		// meta/dbs.yaml line #11
		/* partial({'dbs_created':1}) */
		var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"dbs_created": 1})
		/* r.db_create('a') */

		suite.T().Log("About to run line #11: r.DBCreate('a')")

		runAndAssert(suite.Suite, expected_, r.DBCreate("a"), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #11")
	}

	{
		// meta/dbs.yaml line #13
		/* partial({'dbs_created':1}) */
		var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"dbs_created": 1})
		/* r.db_create('b') */

		suite.T().Log("About to run line #13: r.DBCreate('b')")

		runAndAssert(suite.Suite, expected_, r.DBCreate("b"), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #13")
	}

	{
		// meta/dbs.yaml line #18
		/* bag(['rethinkdb', 'a', 'b', 'test']) */
		var expected_ compare.Expected = compare.UnorderedMatch([]interface{}{"rethinkdb", "a", "b", "test"})
		/* r.db_list() */

		suite.T().Log("About to run line #18: r.DBList()")

		runAndAssert(suite.Suite, expected_, r.DBList(), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #18")
	}

	{
		// meta/dbs.yaml line #23
		/* {'name':'a','id':uuid()} */
		var expected_ map[interface{}]interface{} = map[interface{}]interface{}{"name": "a", "id": compare.IsUUID()}
		/* r.db('a').config() */

		suite.T().Log("About to run line #23: r.DB('a').Config()")

		runAndAssert(suite.Suite, expected_, r.DB("a").Config(), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #23")
	}

	{
		// meta/dbs.yaml line #28
		/* partial({'dbs_dropped':1}) */
		var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"dbs_dropped": 1})
		/* r.db_drop('b') */

		suite.T().Log("About to run line #28: r.DBDrop('b')")

		runAndAssert(suite.Suite, expected_, r.DBDrop("b"), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #28")
	}

	{
		// meta/dbs.yaml line #31
		/* bag(['rethinkdb', 'a', 'test']) */
		var expected_ compare.Expected = compare.UnorderedMatch([]interface{}{"rethinkdb", "a", "test"})
		/* r.db_list() */

		suite.T().Log("About to run line #31: r.DBList()")
//.........这里部分代码省略.........
开发者ID:freedmand,项目名称:doc.vu,代码行数:101,代码来源:reql_meta_dbs_test.go


示例12: TestCases

func (suite *MetaCompositeSuite) TestCases() {
	suite.T().Log("Running MetaCompositeSuite: Tests meta operations in composite queries")

	{
		// meta/composite.py.yaml line #4
		/* ({'dbs_created':3,'config_changes':arrlen(3)}) */
		var expected_ map[interface{}]interface{} = map[interface{}]interface{}{"dbs_created": 3, "config_changes": arrlen(3)}
		/* r.expr([1,2,3]).for_each(r.db_create('db_' + r.row.coerce_to('string'))) */

		suite.T().Log("About to run line #4: r.Expr([]interface{}{1, 2, 3}).ForEach(r.DBCreate(r.Add('db_', r.Row.CoerceTo('string'))))")

		runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).ForEach(r.DBCreate(r.Add("db_", r.Row.CoerceTo("string")))), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #4")
	}

	{
		// meta/composite.py.yaml line #8
		/* partial({'tables_created':9}) */
		var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"tables_created": 9})
		/* r.db_list().set_difference(["rethinkdb", "test"]).for_each(lambda db_name:
		r.expr([1,2,3]).for_each(lambda i:
		r.db(db_name).table_create('tbl_' + i.coerce_to('string')))) */

		suite.T().Log("About to run line #8: r.DBList().SetDifference([]interface{}{'rethinkdb', 'test'}).ForEach(func(db_name r.Term) interface{} { return r.Expr([]interface{}{1, 2, 3}).ForEach(func(i r.Term) interface{} { return r.DB(db_name).TableCreate(r.Add('tbl_', i.CoerceTo('string')))})})")

		runAndAssert(suite.Suite, expected_, r.DBList().SetDifference([]interface{}{"rethinkdb", "test"}).ForEach(func(db_name r.Term) interface{} {
			return r.Expr([]interface{}{1, 2, 3}).ForEach(func(i r.Term) interface{} { return r.DB(db_name).TableCreate(r.Add("tbl_", i.CoerceTo("string"))) })
		}), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #8")
	}

	{
		// meta/composite.py.yaml line #13
		/* partial({'dbs_dropped':3,'tables_dropped':9}) */
		var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"dbs_dropped": 3, "tables_dropped": 9})
		/* r.db_list().set_difference(["rethinkdb", "test"]).for_each(r.db_drop(r.row)) */

		suite.T().Log("About to run line #13: r.DBList().SetDifference([]interface{}{'rethinkdb', 'test'}).ForEach(r.DBDrop(r.Row))")

		runAndAssert(suite.Suite, expected_, r.DBList().SetDifference([]interface{}{"rethinkdb", "test"}).ForEach(r.DBDrop(r.Row)), suite.session, r.RunOpts{
			GeometryFormat: "raw",
			GroupFormat:    "map",
		})
		suite.T().Log("Finished running line #13")
	}
}
开发者ID:freedmand,项目名称:doc.vu,代码行数:52,代码来源:reql_meta_composite_test.go



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Golang v2.Expr函数代码示例发布时间:2022-05-28
下一篇:
Golang v2.DBCreate函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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