MCPcopy Create free account
hub / github.com/araddon/qlbridge / LoadTestDataOnce

Function LoadTestDataOnce

datasource/mockcsvtestdata/testdata.go:36–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36func LoadTestDataOnce() {
37 loadData.Do(func() {
38
39 // Load in a "csv file" into our mock data store
40 mockcsv.LoadTable(mockcsv.SchemaName, "users", `user_id,email,interests,reg_date,referral_count,json_data
419Ip1aKbeZe2njCDM,"aaron@email.com","fishing","2012-10-17T17:29:39.738Z",82,"{""name"":""aaron""}"
42hT2impsOPUREcVPc,"bob@email.com","swimming","2009-12-11T19:53:31.547Z",12,"{""name"":""bob""}"
43hT2impsabc345c,"not_an_email_2",,"2009-12-11T19:53:31.547Z",12,"{""name"":""notbob""}"`)
44
45 mockcsv.LoadTable(mockcsv.SchemaName, "orders", `order_id,user_id,item_id,price,order_date,item_count
461,9Ip1aKbeZe2njCDM,1,22.50,"2012-12-24T17:29:39.738Z",82
472,9Ip1aKbeZe2njCDM,2,37.50,"2013-10-24T17:29:39.738Z",82
483,abcabcabc,1,22.50,"2013-10-24T17:29:39.738Z",82
49`)
50
51 MockSchema = mockcsv.Schema()
52 if MockSchema == nil {
53 panic("MockSchema Must Exist")
54 }
55
56 SetContextToMockCsv()
57
58 //reg.RefreshSchema(mockcsv.SchemaName)
59 builtins.LoadAllBuiltins()
60 })
61}

Callers

nothing calls this directly

Calls 5

LoadTableFunction · 0.92
SchemaFunction · 0.92
LoadAllBuiltinsFunction · 0.92
SetContextToMockCsvFunction · 0.85
DoMethod · 0.65

Tested by

no test coverage detected