mirror of
				https://github.com/chaisql/chai.git
				synced 2025-11-01 03:12:38 +08:00 
			
		
		
		
	Thread safe statements (#406)
Previously, expressions and params were evaluated during the planning phase. This change builds the query plan without evaluating params and expressions which are then evaluated only during the execution phase.
This commit is contained in:
		| @@ -6,6 +6,7 @@ import ( | ||||
| 	"github.com/genjidb/genji/internal/expr" | ||||
| 	"github.com/genjidb/genji/internal/query/statement" | ||||
| 	"github.com/genjidb/genji/internal/sql/parser" | ||||
| 	"github.com/genjidb/genji/internal/stream" | ||||
| 	"github.com/stretchr/testify/require" | ||||
| ) | ||||
|  | ||||
| @@ -16,9 +17,9 @@ func TestParserExplain(t *testing.T) { | ||||
| 		expected statement.Statement | ||||
| 		errored  bool | ||||
| 	}{ | ||||
| 		{"Explain create table", "EXPLAIN SELECT * FROM test", &statement.ExplainStmt{Statement: &statement.SelectStmt{ | ||||
| 			TableName:       "test", | ||||
| 			ProjectionExprs: []expr.Expr{expr.Wildcard{}}, | ||||
| 		{"Explain create table", "EXPLAIN SELECT * FROM test", &statement.ExplainStmt{Statement: &statement.StreamStmt{ | ||||
| 			ReadOnly: true, | ||||
| 			Stream:   stream.New(stream.SeqScan("test")).Pipe(stream.Project(expr.Wildcard{})), | ||||
| 		}}, false}, | ||||
| 		{"Multiple Explains", "EXPLAIN EXPLAIN CREATE TABLE test", nil, true}, | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Asdine El Hrychy
					Asdine El Hrychy