aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/sqlvm/schema/schema.go
Commit message (Collapse)AuthorAgeFilesLines
* core: vm: sqlvm: runtime: implement fillAutoInc and fillDefaultJhih-Ming Huang2019-05-081-2/+3
| | | | | | This commit implements fillAutoInc and fillDefault, and modifies Storage.IncSequence such that it can handle the numbers larger than maximum of uint64.
* core: vm: sqlvm: return a bool from DecimalEncode and DecimalDecodeTing-Wei Lan2019-05-081-11/+13
| | | | | | | Instead of returning a fixed error code, we can return a boolean here because the only possibility of an error is invalid arguments. Callers of these functions must know where invalid arguments come from, and correctly handle it by converting it to an error struct or panicking.
* core: vm: sqlvm: schema: column rlp does not contain offset fieldswmin02019-05-061-2/+2
|
* misc: replace shopspring/decimal with our forkyenlin.lai2019-05-061-1/+1
|
* core: vm: sqlvm: schema: make foreign key constraints a sliceTing-Wei Lan2019-05-061-16/+14
| | | | It is allowed to declare multiple foreign key constraints on a column.
* core: vm: sqlvm: add a descriptor field to IdentifierNodeTing-Wei Lan2019-05-061-0/+43
| | | | | It will be used to store the descriptor of the object after the name is resolved.
* core: vm: sqlvm: schema: move Rest to the bottomTing-Wei Lan2019-05-061-1/+3
| | | | It is a special field which should not be accessed by any other files.
* core: vm: sqlvm: schema: unsigned integers can never be negativeTing-Wei Lan2019-05-061-2/+2
|
* core: vm: sqlvm: use common.HashLength instead of 32Ting-Wei Lan2019-05-061-1/+2
| | | | Keep them consisitent with ast/types.go.
* core: vm: sqlvm: schema: implment get column field type and set offsetJhih-Ming Huang2019-05-061-0/+56
| | | | | Since we have to packing our data in slot, it needs to calculate each column field's slot and byte offset.
* core: vm: sqlvm: schema: add structs to identify an object in a schemaTing-Wei Lan2019-05-061-0/+26
| | | | | These structs will be used in identifier nodes to store references to objects defined in the schema or the command itself.
* core: vm: sqlvm: schema: mark if an index are referenced by foreign keysTing-Wei Lan2019-05-061-0/+36
| | | | | | | In order to check foreign keys efficiently during deletion, an index should be marked when it is referenced by foreign keys. Since we now have flags which cannot be declared directly from the source code, two helper functions are added to distinguish between two groups of flags.
* core: vm: sqlvm: schema: reorder fields and enumsTing-Wei Lan2019-05-061-6/+19
| | | | | Reorder fields and enums according to the grammar file to make it easier to check whether all features supported by the grammar are implemented.
* core: vm: sqlvm: schema: drop pointers from slicesTing-Wei Lan2019-05-061-3/+3
| | | | | | | The number of tables, columns, indices are all limited to 256, so we don't have to do much memory copying during appending. Drop pointers from slices to save memory for storing pointers and possibly improve locality.
* core: sqlvm: schema: define type for table/column/index/sequence sizeyenlin.lai2019-05-061-4/+16
| | | | | The size of table in db and column/index/sequence in a table is bounded by uint8. Define types for better readability.
* core: vm: sqlvm: add schema define and implement rlp serializationwmin02019-05-061-0/+139
Implement schema struct and handle its rlp serialization.