File tree 2 files changed +38
-0
lines changed
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1
1
mod ast;
2
2
mod lexer;
3
+ mod mem_backend;
3
4
mod parser;
4
5
use parser:: parse;
5
6
Original file line number Diff line number Diff line change
1
+ pub enum ColumnType {
2
+ TextType ,
3
+ IntType ,
4
+ }
5
+
6
+ pub trait Backend {
7
+ fn create ( & self ) -> Result < ( ) , ( ) > ;
8
+ fn insert ( & self ) -> Result < ( ) , ( ) > ;
9
+ fn update ( & self ) -> Result < ( ) , ( ) > ;
10
+ }
11
+
12
+ trait Cell {
13
+ fn as_text ( & self ) -> String ;
14
+ fn as_int ( & self ) -> u32 ;
15
+ }
16
+
17
+ pub struct Column {
18
+ col_type : ColumnType ,
19
+ col_name : String ,
20
+ }
21
+
22
+ type MemCell = Vec < u8 > ;
23
+
24
+ impl Cell for MemCell {
25
+ fn as_int ( & self ) -> u32 {
26
+ return 1 ;
27
+ }
28
+
29
+ fn as_text ( & self ) -> String {
30
+ return String :: new ( ) ;
31
+ }
32
+ }
33
+
34
+ pub struct Results {
35
+ pub columns : Vec < Column > ,
36
+ pub rows : Vec < Vec < MemCell > > ,
37
+ }
You can’t perform that action at this time.
0 commit comments