mirror of
				https://github.com/chaisql/chai.git
				synced 2025-10-31 19:02:48 +08:00 
			
		
		
		
	db: introduce row type
This commit is contained in:
		| @@ -8,7 +8,7 @@ import ( | ||||
| 	"github.com/genjidb/genji/internal/query/statement" | ||||
| 	"github.com/genjidb/genji/internal/sql/parser" | ||||
| 	"github.com/genjidb/genji/internal/stream" | ||||
| 	"github.com/genjidb/genji/internal/stream/docs" | ||||
| 	"github.com/genjidb/genji/internal/stream/rows" | ||||
| 	"github.com/genjidb/genji/internal/stream/table" | ||||
| 	"github.com/genjidb/genji/internal/testutil" | ||||
| 	"github.com/genjidb/genji/internal/testutil/assert" | ||||
| @@ -25,37 +25,37 @@ func TestParserDelete(t *testing.T) { | ||||
| 			Pipe(stream.Discard())}, | ||||
| 		{"WithCond", "DELETE FROM test WHERE age = 10", | ||||
| 			stream.New(table.Scan("test")). | ||||
| 				Pipe(docs.Filter(parser.MustParseExpr("age = 10"))). | ||||
| 				Pipe(rows.Filter(parser.MustParseExpr("age = 10"))). | ||||
| 				Pipe(table.Delete("test")). | ||||
| 				Pipe(stream.Discard()), | ||||
| 		}, | ||||
| 		{"WithOffset", "DELETE FROM test WHERE age = 10 OFFSET 20", | ||||
| 			stream.New(table.Scan("test")). | ||||
| 				Pipe(docs.Filter(parser.MustParseExpr("age = 10"))). | ||||
| 				Pipe(docs.Skip(parser.MustParseExpr("20"))). | ||||
| 				Pipe(rows.Filter(parser.MustParseExpr("age = 10"))). | ||||
| 				Pipe(rows.Skip(parser.MustParseExpr("20"))). | ||||
| 				Pipe(table.Delete("test")). | ||||
| 				Pipe(stream.Discard()), | ||||
| 		}, | ||||
| 		{"WithLimit", "DELETE FROM test LIMIT 10", | ||||
| 			stream.New(table.Scan("test")). | ||||
| 				Pipe(docs.Take(parser.MustParseExpr("10"))). | ||||
| 				Pipe(rows.Take(parser.MustParseExpr("10"))). | ||||
| 				Pipe(table.Delete("test")). | ||||
| 				Pipe(stream.Discard()), | ||||
| 		}, | ||||
| 		{"WithOrderByThenOffset", "DELETE FROM test WHERE age = 10 ORDER BY age OFFSET 20", | ||||
| 			stream.New(table.Scan("test")). | ||||
| 				Pipe(docs.Filter(parser.MustParseExpr("age = 10"))). | ||||
| 				Pipe(docs.TempTreeSort(parser.MustParseExpr("age"))). | ||||
| 				Pipe(docs.Skip(parser.MustParseExpr("20"))). | ||||
| 				Pipe(rows.Filter(parser.MustParseExpr("age = 10"))). | ||||
| 				Pipe(rows.TempTreeSort(parser.MustParseExpr("age"))). | ||||
| 				Pipe(rows.Skip(parser.MustParseExpr("20"))). | ||||
| 				Pipe(table.Delete("test")). | ||||
| 				Pipe(stream.Discard()), | ||||
| 		}, | ||||
| 		{"WithOrderByThenLimitThenOffset", "DELETE FROM test WHERE age = 10 ORDER BY age LIMIT 10 OFFSET 20", | ||||
| 			stream.New(table.Scan("test")). | ||||
| 				Pipe(docs.Filter(parser.MustParseExpr("age = 10"))). | ||||
| 				Pipe(docs.TempTreeSort(parser.MustParseExpr("age"))). | ||||
| 				Pipe(docs.Skip(parser.MustParseExpr("20"))). | ||||
| 				Pipe(docs.Take(parser.MustParseExpr("10"))). | ||||
| 				Pipe(rows.Filter(parser.MustParseExpr("age = 10"))). | ||||
| 				Pipe(rows.TempTreeSort(parser.MustParseExpr("age"))). | ||||
| 				Pipe(rows.Skip(parser.MustParseExpr("20"))). | ||||
| 				Pipe(rows.Take(parser.MustParseExpr("10"))). | ||||
| 				Pipe(table.Delete("test")). | ||||
| 				Pipe(stream.Discard()), | ||||
| 		}, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Asdine El Hrychy
					Asdine El Hrychy