Comments (2)
I re-manage a little bit the syntax.
I believe it could be interesting to explore a different syntax and semantic.
I am thinking about commands like:
REDISQL.GET tableName:[index=>value]:[fields]
REDISQL.INSERT tableName:[fields] [values]
REDISQL.SET tableName:[index=>value]:[fields] [value]
REDISQL.DELETE tableName:[index=>value]
This is interesting because it is possible to define a regular grammar for it and use that for parsing:
GET = tableName:tableName sep
ind:((indexes sep fields) / (fields sep indexes))
multipleSpace values:values {
return {
tableName: tableName,
indexes: ind[0]["indexes"],
fields: ind[2]["fields"],
values: values
}
}
SET = tableName sep ((indexes sep fields) / (fields sep indexes)) multipleSpace values
INSERT = tableName sep fields multipleSpace values
DELETE = tableName sep indexes
sep = ':'
arrow = '=>'
tableName = ch:[a-zA-Z0-9]* {return ch.join("")}
indexName = ch:[a-zA-Z0-9]* {return ch.join("")}
indexValue = ch:[a-zA-Z0-9]* {return ch.join("")}
field = ch:[a-zA-Z0-9]* {return [ch.join("")]}
value = ch:[a-zA-Z0-9]* {return [ch.join("")]}
space = ' '
multipleSpace = ' '* {return ' '}
index = name:indexName arrow value:indexValue {return [[name, value]]}
indexes = head:index tail:(sep index)* {
return {indexes: tail.reduce(function (result, element) {
return result.concat(element[1])
}, head)}
}
fields = head:field tail:(sep field)* {
return {fields: tail.reduce(function (result, element) {
return result.concat(element[1])
}, head)}
}
values = head:value tail:(space value)* {
return tail.reduce(function (result, element) {
return result.concat(element[1])
}, head)
}
from redisql.
I decide that projections are not a good idea yet.
I will skip this for now.
from redisql.
Related Issues (20)
- Confused on the Pro Version - Latest Stable Release HOT 6
- extension load HOT 5
- how can i use rediSQL to save a picture to redis HOT 6
- redis bgsave run 48 hours ,but no data in the memory was dumped into the .rdb file HOT 15
- C++ example HOT 3
- can‘t exec CREATE TABLE HOT 2
- Bulk insert HOT 5
- The sequence of data columns returned by "select * ..." is wrong HOT 11
- .NET Core Tutorial Request HOT 2
- Redissql with JAVA HOT 1
- ramp packer HOT 2
- benchmarks HOT 2
- cargo build failed
- Documentation link is broken HOT 4
- 32bit build HOT 9
- Can this be compiled to web assembly ? HOT 4
- RediSQL in .net core HOT 4
- Remove RediSQL from Redis HOT 1
- Considering closing the repo HOT 12
- Build for Windows HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redisql.