commit
de34095ece
12 changed files with 231 additions and 84 deletions
|
|
@ -168,7 +168,7 @@ func UPPER(stringExpression StringExpression) StringExpression {
|
||||||
// in characters (a space by default) from the start and end of string
|
// in characters (a space by default) from the start and end of string
|
||||||
func BTRIM(stringExpression StringExpression, trimChars ...StringExpression) StringExpression {
|
func BTRIM(stringExpression StringExpression, trimChars ...StringExpression) StringExpression {
|
||||||
if len(trimChars) > 0 {
|
if len(trimChars) > 0 {
|
||||||
return newStringFunc("LTRIM", stringExpression, trimChars[0])
|
return newStringFunc("BTRIM", stringExpression, trimChars[0])
|
||||||
}
|
}
|
||||||
return newStringFunc("BTRIM", stringExpression)
|
return newStringFunc("BTRIM", stringExpression)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -155,3 +155,8 @@ func TestFuncLEAST(t *testing.T) {
|
||||||
assertClauseSerialize(t, LEAST(table1ColFloat), "LEAST(table1.col_float)")
|
assertClauseSerialize(t, LEAST(table1ColFloat), "LEAST(table1.col_float)")
|
||||||
assertClauseSerialize(t, LEAST(Float(11.2222), NULL, String("str")), "LEAST($1, NULL, $2)", float64(11.2222), "str")
|
assertClauseSerialize(t, LEAST(Float(11.2222), NULL, String("str")), "LEAST($1, NULL, $2)", float64(11.2222), "str")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTO_ASCII(t *testing.T) {
|
||||||
|
assertClauseSerialize(t, TO_ASCII(String("Karel")), `TO_ASCII($1)`, "Karel")
|
||||||
|
assertClauseSerialize(t, TO_ASCII(String("Karel")), `TO_ASCII($1)`, "Karel")
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,10 @@ func TestStringOperators(t *testing.T) {
|
||||||
LOWER(AllTypes.CharacterVaryingPtr),
|
LOWER(AllTypes.CharacterVaryingPtr),
|
||||||
UPPER(AllTypes.Character),
|
UPPER(AllTypes.Character),
|
||||||
BTRIM(AllTypes.CharacterVarying),
|
BTRIM(AllTypes.CharacterVarying),
|
||||||
|
BTRIM(AllTypes.CharacterVarying, String("AA")),
|
||||||
|
LTRIM(AllTypes.CharacterVarying),
|
||||||
LTRIM(AllTypes.CharacterVarying, String("A")),
|
LTRIM(AllTypes.CharacterVarying, String("A")),
|
||||||
|
RTRIM(AllTypes.CharacterVarying),
|
||||||
RTRIM(AllTypes.CharacterVarying, String("B")),
|
RTRIM(AllTypes.CharacterVarying, String("B")),
|
||||||
CHR(Int(65)),
|
CHR(Int(65)),
|
||||||
//CONCAT(String("string1"), Int(1), Float(11.12)),
|
//CONCAT(String("string1"), Int(1), Float(11.12)),
|
||||||
|
|
@ -143,13 +146,16 @@ func TestStringOperators(t *testing.T) {
|
||||||
RIGHT(String("abcde"), Int(2)),
|
RIGHT(String("abcde"), Int(2)),
|
||||||
LENGTH(String("jose")),
|
LENGTH(String("jose")),
|
||||||
LENGTH(String("jose"), String("UTF8")),
|
LENGTH(String("jose"), String("UTF8")),
|
||||||
|
LPAD(String("Hi"), Int(5)),
|
||||||
LPAD(String("Hi"), Int(5), String("xy")),
|
LPAD(String("Hi"), Int(5), String("xy")),
|
||||||
|
RPAD(String("Hi"), Int(5)),
|
||||||
RPAD(String("Hi"), Int(5), String("xy")),
|
RPAD(String("Hi"), Int(5), String("xy")),
|
||||||
MD5(AllTypes.CharacterVarying),
|
MD5(AllTypes.CharacterVarying),
|
||||||
REPEAT(AllTypes.Text, Int(33)),
|
REPEAT(AllTypes.Text, Int(33)),
|
||||||
REPLACE(AllTypes.Character, String("BA"), String("AB")),
|
REPLACE(AllTypes.Character, String("BA"), String("AB")),
|
||||||
REVERSE(AllTypes.CharacterVarying),
|
REVERSE(AllTypes.CharacterVarying),
|
||||||
STRPOS(AllTypes.Text, String("A")),
|
STRPOS(AllTypes.Text, String("A")),
|
||||||
|
SUBSTR(AllTypes.CharacterPtr, Int(3)),
|
||||||
SUBSTR(AllTypes.CharacterPtr, Int(3), Int(2)),
|
SUBSTR(AllTypes.CharacterPtr, Int(3), Int(2)),
|
||||||
TO_HEX(AllTypes.IntegerPtr),
|
TO_HEX(AllTypes.IntegerPtr),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -246,23 +246,21 @@ ORDER BY "Album.AlbumId";
|
||||||
assert.DeepEqual(t, dest[1], album2)
|
assert.DeepEqual(t, dest[1], album2)
|
||||||
}
|
}
|
||||||
|
|
||||||
//func TestQueryWithContext(t *testing.T) {
|
func TestQueryWithContext(t *testing.T) {
|
||||||
//
|
|
||||||
// ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
|
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
|
||||||
// defer cancel()
|
defer cancel()
|
||||||
//
|
|
||||||
// dest := []model.Album{}
|
dest := []model.Album{}
|
||||||
//
|
|
||||||
// err := Album.
|
err := Album.
|
||||||
// CROSS_JOIN(Track).
|
CROSS_JOIN(Track).
|
||||||
// CROSS_JOIN(InvoiceLine).
|
CROSS_JOIN(InvoiceLine).
|
||||||
// SELECT(Album.AllColumns, Track.AllColumns, InvoiceLine.AllColumns).
|
SELECT(Album.AllColumns, Track.AllColumns, InvoiceLine.AllColumns).
|
||||||
// QueryContext(db, ctx, &dest)
|
QueryContext(ctx, db, &dest)
|
||||||
//
|
|
||||||
// spew.Dump(dest)
|
assert.Error(t, err, "context deadline exceeded")
|
||||||
//
|
}
|
||||||
// assert.Error(t, err, "context deadline exceeded")
|
|
||||||
//}
|
|
||||||
|
|
||||||
func TestExecWithContext(t *testing.T) {
|
func TestExecWithContext(t *testing.T) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
package tests
|
package tests
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
. "github.com/go-jet/jet"
|
. "github.com/go-jet/jet"
|
||||||
"github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/model"
|
"github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/model"
|
||||||
. "github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/table"
|
. "github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/table"
|
||||||
"gotest.tools/assert"
|
"gotest.tools/assert"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDeleteWithWhere(t *testing.T) {
|
func TestDeleteWithWhere(t *testing.T) {
|
||||||
|
|
@ -60,3 +62,38 @@ func initForDeleteTest(t *testing.T) {
|
||||||
|
|
||||||
assertExec(t, stmt, 2)
|
assertExec(t, stmt, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestDeleteQueryContext(t *testing.T) {
|
||||||
|
initForDeleteTest(t)
|
||||||
|
|
||||||
|
deleteStmt := Link.
|
||||||
|
DELETE().
|
||||||
|
WHERE(Link.Name.IN(String("Gmail"), String("Outlook")))
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
|
dest := []model.Link{}
|
||||||
|
err := deleteStmt.QueryContext(ctx, db, &dest)
|
||||||
|
|
||||||
|
assert.Error(t, err, "context deadline exceeded")
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDeleteExecContext(t *testing.T) {
|
||||||
|
initForDeleteTest(t)
|
||||||
|
|
||||||
|
deleteStmt := Link.
|
||||||
|
DELETE().
|
||||||
|
WHERE(Link.Name.IN(String("Gmail"), String("Outlook")))
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
|
_, err := deleteStmt.ExecContext(ctx, db)
|
||||||
|
|
||||||
|
assert.Error(t, err, "context deadline exceeded")
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
package tests
|
package tests
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
. "github.com/go-jet/jet"
|
. "github.com/go-jet/jet"
|
||||||
"github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/model"
|
"github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/model"
|
||||||
. "github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/table"
|
. "github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/table"
|
||||||
"gotest.tools/assert"
|
"gotest.tools/assert"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestInsertValues(t *testing.T) {
|
func TestInsertValues(t *testing.T) {
|
||||||
|
|
@ -245,3 +247,37 @@ RETURNING link.id AS "link.id",
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Equal(t, len(youtubeLinks), 2)
|
assert.Equal(t, len(youtubeLinks), 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestInsertWithQueryContext(t *testing.T) {
|
||||||
|
cleanUpLinkTable(t)
|
||||||
|
|
||||||
|
stmt := Link.INSERT().
|
||||||
|
VALUES(1100, "http://www.postgresqltutorial.com", "PostgreSQL Tutorial", DEFAULT).
|
||||||
|
RETURNING(Link.AllColumns)
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
|
dest := []model.Link{}
|
||||||
|
err := stmt.QueryContext(ctx, db, &dest)
|
||||||
|
|
||||||
|
assert.Error(t, err, "context deadline exceeded")
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestInsertWithExecContext(t *testing.T) {
|
||||||
|
cleanUpLinkTable(t)
|
||||||
|
|
||||||
|
stmt := Link.INSERT().
|
||||||
|
VALUES(100, "http://www.postgresqltutorial.com", "PostgreSQL Tutorial", DEFAULT)
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
|
_, err := stmt.ExecContext(ctx, db)
|
||||||
|
|
||||||
|
assert.Error(t, err, "context deadline exceeded")
|
||||||
|
}
|
||||||
|
|
|
||||||
73
tests/lock_test.go
Normal file
73
tests/lock_test.go
Normal file
|
|
@ -0,0 +1,73 @@
|
||||||
|
package tests
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"gotest.tools/assert"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
. "github.com/go-jet/jet"
|
||||||
|
. "github.com/go-jet/jet/tests/.gentestdata/jetdb/dvds/table"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestLockTable(t *testing.T) {
|
||||||
|
expectedSQL := `
|
||||||
|
LOCK TABLE dvds.address IN`
|
||||||
|
|
||||||
|
var testData = []TableLockMode{
|
||||||
|
LOCK_ACCESS_SHARE,
|
||||||
|
LOCK_ROW_SHARE,
|
||||||
|
LOCK_ROW_EXCLUSIVE,
|
||||||
|
LOCK_SHARE_UPDATE_EXCLUSIVE,
|
||||||
|
LOCK_SHARE,
|
||||||
|
LOCK_SHARE_ROW_EXCLUSIVE,
|
||||||
|
LOCK_EXCLUSIVE,
|
||||||
|
LOCK_ACCESS_EXCLUSIVE,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, lockMode := range testData {
|
||||||
|
query := Address.LOCK().IN(lockMode)
|
||||||
|
|
||||||
|
assertStatementSql(t, query, expectedSQL+" "+string(lockMode)+" MODE;\n")
|
||||||
|
|
||||||
|
tx, _ := db.Begin()
|
||||||
|
|
||||||
|
_, err := query.Exec(tx)
|
||||||
|
|
||||||
|
assert.NilError(t, err)
|
||||||
|
|
||||||
|
err = tx.Rollback()
|
||||||
|
|
||||||
|
assert.NilError(t, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, lockMode := range testData {
|
||||||
|
query := Address.LOCK().IN(lockMode).NOWAIT()
|
||||||
|
|
||||||
|
assertStatementSql(t, query, expectedSQL+" "+string(lockMode)+" MODE NOWAIT;\n")
|
||||||
|
|
||||||
|
tx, _ := db.Begin()
|
||||||
|
|
||||||
|
_, err := query.Exec(tx)
|
||||||
|
|
||||||
|
assert.NilError(t, err)
|
||||||
|
|
||||||
|
err = tx.Rollback()
|
||||||
|
|
||||||
|
assert.NilError(t, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestLockExecContext(t *testing.T) {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
|
tx, _ := db.Begin()
|
||||||
|
defer tx.Rollback()
|
||||||
|
|
||||||
|
_, err := Address.LOCK().IN(LOCK_ACCESS_SHARE).ExecContext(ctx, tx)
|
||||||
|
|
||||||
|
assert.Error(t, err, "context deadline exceeded")
|
||||||
|
}
|
||||||
|
|
@ -119,6 +119,7 @@ func assertGeneratedFiles(t *testing.T) {
|
||||||
|
|
||||||
// Enums SQL Builder files
|
// Enums SQL Builder files
|
||||||
enumFiles, err := ioutil.ReadDir("./.gentestdata2/jetdb/dvds/enum")
|
enumFiles, err := ioutil.ReadDir("./.gentestdata2/jetdb/dvds/enum")
|
||||||
|
assert.NilError(t, err)
|
||||||
|
|
||||||
assertFileNameEqual(t, enumFiles, "mpaa_rating.go")
|
assertFileNameEqual(t, enumFiles, "mpaa_rating.go")
|
||||||
assertFileContent(t, "./.gentestdata2/jetdb/dvds/enum/mpaa_rating.go", "\npackage enum", mpaaRatingEnumFile)
|
assertFileContent(t, "./.gentestdata2/jetdb/dvds/enum/mpaa_rating.go", "\npackage enum", mpaaRatingEnumFile)
|
||||||
|
|
|
||||||
|
|
@ -1315,54 +1315,6 @@ LIMIT 20;
|
||||||
assert.Equal(t, dest[1].StaffIDNum, "ONE")
|
assert.Equal(t, dest[1].StaffIDNum, "ONE")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLockTable(t *testing.T) {
|
|
||||||
expectedSQL := `
|
|
||||||
LOCK TABLE dvds.address IN`
|
|
||||||
|
|
||||||
var testData = []TableLockMode{
|
|
||||||
LOCK_ACCESS_SHARE,
|
|
||||||
LOCK_ROW_SHARE,
|
|
||||||
LOCK_ROW_EXCLUSIVE,
|
|
||||||
LOCK_SHARE_UPDATE_EXCLUSIVE,
|
|
||||||
LOCK_SHARE,
|
|
||||||
LOCK_SHARE_ROW_EXCLUSIVE,
|
|
||||||
LOCK_EXCLUSIVE,
|
|
||||||
LOCK_ACCESS_EXCLUSIVE,
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, lockMode := range testData {
|
|
||||||
query := Address.LOCK().IN(lockMode)
|
|
||||||
|
|
||||||
assertStatementSql(t, query, expectedSQL+" "+string(lockMode)+" MODE;\n")
|
|
||||||
|
|
||||||
tx, _ := db.Begin()
|
|
||||||
|
|
||||||
_, err := query.Exec(tx)
|
|
||||||
|
|
||||||
assert.NilError(t, err)
|
|
||||||
|
|
||||||
err = tx.Rollback()
|
|
||||||
|
|
||||||
assert.NilError(t, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, lockMode := range testData {
|
|
||||||
query := Address.LOCK().IN(lockMode).NOWAIT()
|
|
||||||
|
|
||||||
assertStatementSql(t, query, expectedSQL+" "+string(lockMode)+" MODE NOWAIT;\n")
|
|
||||||
|
|
||||||
tx, _ := db.Begin()
|
|
||||||
|
|
||||||
_, err := query.Exec(tx)
|
|
||||||
|
|
||||||
assert.NilError(t, err)
|
|
||||||
|
|
||||||
err = tx.Rollback()
|
|
||||||
|
|
||||||
assert.NilError(t, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func getRowLockTestData() map[SelectLock]string {
|
func getRowLockTestData() map[SelectLock]string {
|
||||||
return map[SelectLock]string{
|
return map[SelectLock]string{
|
||||||
UPDATE(): "UPDATE",
|
UPDATE(): "UPDATE",
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
package tests
|
package tests
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
. "github.com/go-jet/jet"
|
. "github.com/go-jet/jet"
|
||||||
"github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/model"
|
"github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/model"
|
||||||
. "github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/table"
|
. "github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/table"
|
||||||
"gotest.tools/assert"
|
"gotest.tools/assert"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestUpdateValues(t *testing.T) {
|
func TestUpdateValues(t *testing.T) {
|
||||||
|
|
@ -241,6 +243,43 @@ WHERE link.id = 201;
|
||||||
assertExecErr(t, stmt, "pq: number of columns does not match number of values")
|
assertExecErr(t, stmt, "pq: number of columns does not match number of values")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestUpdateQueryContext(t *testing.T) {
|
||||||
|
setupLinkTableForUpdateTest(t)
|
||||||
|
|
||||||
|
updateStmt := Link.
|
||||||
|
UPDATE(Link.Name, Link.URL).
|
||||||
|
SET("Bong", "http://bong.com").
|
||||||
|
WHERE(Link.Name.EQ(String("Bing")))
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
|
dest := []model.Link{}
|
||||||
|
err := updateStmt.QueryContext(ctx, db, &dest)
|
||||||
|
|
||||||
|
assert.Error(t, err, "context deadline exceeded")
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestUpdateExecContext(t *testing.T) {
|
||||||
|
setupLinkTableForUpdateTest(t)
|
||||||
|
|
||||||
|
updateStmt := Link.
|
||||||
|
UPDATE(Link.Name, Link.URL).
|
||||||
|
SET("Bong", "http://bong.com").
|
||||||
|
WHERE(Link.Name.EQ(String("Bing")))
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Microsecond)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
|
_, err := updateStmt.ExecContext(ctx, db)
|
||||||
|
|
||||||
|
assert.Error(t, err, "context deadline exceeded")
|
||||||
|
}
|
||||||
|
|
||||||
func setupLinkTableForUpdateTest(t *testing.T) {
|
func setupLinkTableForUpdateTest(t *testing.T) {
|
||||||
|
|
||||||
cleanUpLinkTable(t)
|
cleanUpLinkTable(t)
|
||||||
|
|
|
||||||
|
|
@ -59,15 +59,15 @@ type prefixTimeExpression struct {
|
||||||
prefixOpExpression
|
prefixOpExpression
|
||||||
}
|
}
|
||||||
|
|
||||||
func newPrefixTimeExpression(operator string, expression Expression) TimeExpression {
|
//func newPrefixTimeExpression(operator string, expression Expression) TimeExpression {
|
||||||
timeExpr := prefixTimeExpression{}
|
// timeExpr := prefixTimeExpression{}
|
||||||
timeExpr.prefixOpExpression = newPrefixExpression(expression, operator)
|
// timeExpr.prefixOpExpression = newPrefixExpression(expression, operator)
|
||||||
|
//
|
||||||
timeExpr.expressionInterfaceImpl.parent = &timeExpr
|
// timeExpr.expressionInterfaceImpl.parent = &timeExpr
|
||||||
timeExpr.timeInterfaceImpl.parent = &timeExpr
|
// timeExpr.timeInterfaceImpl.parent = &timeExpr
|
||||||
|
//
|
||||||
return &timeExpr
|
// return &timeExpr
|
||||||
}
|
//}
|
||||||
|
|
||||||
//---------------------------------------------------//
|
//---------------------------------------------------//
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,15 +67,15 @@ type prefixTimezExpression struct {
|
||||||
prefixOpExpression
|
prefixOpExpression
|
||||||
}
|
}
|
||||||
|
|
||||||
func newPrefixTimezExpression(operator string, expression Expression) TimezExpression {
|
//func newPrefixTimezExpression(operator string, expression Expression) TimezExpression {
|
||||||
timeExpr := prefixTimezExpression{}
|
// timeExpr := prefixTimezExpression{}
|
||||||
timeExpr.prefixOpExpression = newPrefixExpression(expression, operator)
|
// timeExpr.prefixOpExpression = newPrefixExpression(expression, operator)
|
||||||
|
//
|
||||||
timeExpr.expressionInterfaceImpl.parent = &timeExpr
|
// timeExpr.expressionInterfaceImpl.parent = &timeExpr
|
||||||
timeExpr.timezInterfaceImpl.parent = &timeExpr
|
// timeExpr.timezInterfaceImpl.parent = &timeExpr
|
||||||
|
//
|
||||||
return &timeExpr
|
// return &timeExpr
|
||||||
}
|
//}
|
||||||
|
|
||||||
//---------------------------------------------------//
|
//---------------------------------------------------//
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue