LittleD
=======
Hi there! You may be interested in a sister project, [IonDB - A key-value store for embedded devices](https://github.com/iondbproject/iondb).
"What is this?"
---------------
LittleD is a relational database for microprocessor devices, using as little
as 1kB of RAM for most queries. LittleD supports
SELECT-FROM-WHERE syntax, including inner joins, projections, and selections
over arbitrary expressions. LittleD also has support for CREATE TABLE and
INSERT statements. Only integers and fixed-width strings are supported
at this time. In the future, query pre-compilation, network transmission,
network relational operators, aggregation, and improved indexing
are hoped to be implemented.
If you are interested in the design of LittleD, you might want to check out
my published research: [here](http://dl.acm.org/citation.cfm?id=2554891) or
[here](https://people.ok.ubc.ca/rlawrenc/research/Papers/LittleD.pdf).
Show me some code!
------------------
Sure!
```c
#include "Littled/dbparser/dbparser.h"
#define BYTES_LEN 400
int main(void)
{
char memseg[BYTES_LEN];
db_query_mm_t mm;
db_op_base_t* root;
db_tuple_t tuple;
init_query_mm(&mm, memseg, BYTES_LEN);
parse("CREATE TABLE sensors (id int, temp int);", &mm);
init_query_mm(&mm, memseg, BYTES_LEN);
parse("INSERT INTO sensors VALUES (1, 221);", &mm);
init_query_mm(&mm, memseg, BYTES_LEN);
parse("INSERT INTO sensors VALUES (2, 89884);", &mm);
init_query_mm(&mm, memseg, BYTES_LEN);
parse("INSERT INTO sensors VALUES (3, 112);", &mm);
init_query_mm(&mm, memseg, BYTES_LEN);
parse("INSERT INTO sensors VALUES (4, 455);", &mm);
init_query_mm(&mm, memseg, BYTES_LEN);
parse("INSERT INTO sensors VALUES (5, 3313);", &mm);
init_query_mm(&mm, memseg, BYTES_LEN);
parse("INSERT INTO sensors VALUES (6, 11);", &mm);
init_query_mm(&mm, memseg, BYTES_LEN);
parse("INSERT INTO sensors VALUES (7, 99996);", &mm);
init_query_mm(&mm, memseg, BYTES_LEN);
parse("INSERT INTO sensors VALUES (8, 6565);", &mm);
init_query_mm(&mm, memseg, BYTES_LEN);
parse("INSERT INTO sensors VALUES (9, 6565);", &mm);
init_query_mm(&mm, memseg, BYTES_LEN);
root = parse("SELECT * FROM sensors;", &mm);
if (root == NULL)
{
printf("NULL root\n");
}
else
{
init_tuple(&tuple, root->header->tuple_size, root->header->num_attr, &mm);
while (next(root, &tuple, &mm) == 1)
{
int id = getintbyname(&tuple, "id", root->header);
int sensor_val = getintbyname(&tuple, "temp", root->header);;
printf("sensor val: %i (%i)\n", sensor_val, id);
}
}
return 0;
}
```
Detailed Summary
----------------
LittleD provides a SQL frontend to manage data under the relational model.
This project targets devices of about the same capabilities as the Arduino
Mega2560. In a nutshell, the system supports the creation of tables,
data insertion, and SELECT-FROM-WHERE syntax. Error messages are
supported but not mandatory. A simple configuration header file dictates
which features are compiled in so the database's codespace footprint
can be controlled according to application needs. All code except
that needed to interface with Arduinos is written in C.
This project is part of ongoing research being conducted at the
University of British Columbia's Okanagan Campus under the direction
of Dr. Ramon Lawrence. The work has been supported by Dr. Lawrence's
Distributed Data Lab, the Irving K. Barber School of Arts and Sciences,
the Natural Sciences and Engineering Research Council of Canada,
along with a list of people too numerous to name.
Building Instructions
---------------------
To simply build the database locally, in your shell of choice navigate
to the repository root and execute the command
make
To build the unit tests, issue the command
make tests
and navigate to the _bin/tests_ directory within the repository's root
directory. You may run all tests by
./runalltests
Single tests are included in the same directory. The documentation
can be generated using
make docs
and reside in the _doc/doxygen_ directory. Note that doxygen must be installed
for the documentation to be generated. Finally,
make clean
deletes all files created at compile time.
Eclipse Setup
-------------
LittleD can be managed using an Eclipse Makefile project.
Either the packaged C/C++ Eclipse IDE or the installable CDT package
must be used.
First make sure that the repository is cloned.
In Eclipse click **File** -> **Import...**. Within the **Select** window, choose
under **C/C++** the **Existing Code as Makefile Project** option and click
**Next**. Give your Eclipse Project a name and browse to the root of the
project repository to use the code. Choose the correct compiler for your
system and then click **Finish**.
As noted above, there are a small number of make targets that can be used
with the project's Makefile. By right clicking the project in the
**Package Explorer** and selecting **Make Targets** -> **Create...**. Leaving
all options at the their default, enter the name of the target to add
(for instance, _tests_) and then click **OK**. You can then run the Make target
by right clicking on the project in the **Project Explorer** and choosing
**Make Targets** -> **Build...**. Select the target from the list that appears
and click **Build**. Finally, you can run individual files with main methods
by opening them and click the green **Run** button at the top.
Can I contribute?
-----------------
Absolutely! Contributions are welcome! Please make pull requests off the master
branch.
没有合适的资源?快使用搜索试试~ 我知道了~
嵌入式设备和传感器节点 的关系数据库_C语言_代码_相关文件_下载
共101个文件
c:55个
h:37个
cpp:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 119 浏览量
2022-07-13
21:39:17
上传
评论
收藏 232KB ZIP 举报
温馨提示
“这是什么?” LittleD 是用于微处理器设备的关系数据库,大多数查询只使用 1kB 的 RAM。LittleD 支持 SELECT-FROM-WHERE 语法,包括内连接、投影和对任意表达式的选择。LittleD 还支持 CREATE TABLE 和 INSERT 语句。目前仅支持整数和固定宽度的字符串。未来有望实现查询预编译、网络传输、网络关系算子、聚合、改进索引等。 LittleD 提供了一个 SQL 前端来管理关系模型下的数据。该项目针对与 Arduino Mega2560 功能大致相同的设备。简而言之,系统支持创建表、数据插入和SELECT-FROM-WHERE语法。支持错误消息,但不是强制性的。一个简单的配置头文件指示编译了哪些功能,因此可以根据应用程序需要控制数据库的代码空间占用。除了与 Arduinos 交互所需的代码外,所有代码都是用 C 编写的。 更多详情、使用方法,请下载后细读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
嵌入式设备和传感器节点 的关系数据库_C语言_代码_相关文件_下载
(101个子文件)
aggregate_ut.c 226KB
dbparser_ut.c 184KB
dblexer_ut.c 87KB
eet_ut.c 67KB
osijoin_ut.c 50KB
ntjoin_ut.c 49KB
dbparser.c 43KB
sort_ut.c 35KB
dblexer.c 33KB
eet.c 30KB
aggregate.c 27KB
dbparseexpr_ut.c 23KB
dbinsert_ut.c 23KB
dbparseexpr.c 20KB
db_query_mm_ut.c 19KB
select_ut.c 18KB
project_ut.c 14KB
scan_ut.c 12KB
dbcreate_ut.c 12KB
db_query_mm.c 11KB
compare_tuple.c 9KB
dbinsert.c 9KB
CuTest.c 8KB
osijoin.c 8KB
query_output.c 7KB
ntjoin.c 7KB
dbcreate.c 7KB
cfs_init_test_relations.c 7KB
gen_test_relations.c 6KB
gen_bench_relations.c 5KB
scan.c 5KB
project.c 5KB
dbstorage.c 4KB
dbindex.c 4KB
db_ops.c 4KB
relation.c 4KB
gen_test_indexes.c 4KB
tuple.c 4KB
sort.c 4KB
runalltests.c 3KB
select.c 2KB
run_dbparseexpr_ut.c 732B
run_aggregate_ut.c 728B
run_dbparser_ut.c 726B
run_dbinsert_ut.c 726B
run_dbcreate_ut.c 726B
run_dblexer_ut.c 724B
run_osijoin_ut.c 724B
run_project_ut.c 724B
run_select_ut.c 722B
run_ntjoin_ut.c 722B
run_db_query_mm_ut.c 720B
run_sort_ut.c 718B
run_scan_ut.c 718B
run_eet_ut.c 716B
SD_c_iface.cpp 2KB
arduinodebug.cpp 1KB
Doxyfile 74KB
.gitignore 722B
pstdint.h 26KB
eet.h 15KB
db_query_mm.h 12KB
db_ops_types.h 11KB
dblexer.h 11KB
tuple.h 7KB
relation.h 6KB
osijoin.h 5KB
compare_tuple.h 5KB
db_types.h 5KB
query_output.h 4KB
db_ctconf.h 4KB
dbstorage.h 4KB
SD_c_iface.h 4KB
CuTest.h 4KB
db_ops.h 4KB
dbindex.h 4KB
dbparseexpr.h 3KB
dbmacros.h 3KB
aggregate.h 3KB
db_aggr_func_codes.h 3KB
select.h 3KB
ntjoin.h 3KB
sort.h 2KB
project.h 2KB
dbparser.h 2KB
scan.h 2KB
cfs_init_test_relations.h 2KB
mainpage.h 2KB
dbinsert.h 2KB
dbcreate.h 2KB
arduinodebug.h 2KB
dberror.h 2KB
gen_bench_relations.h 1KB
dbindex_types.h 1KB
ref.h 1KB
debug.h 1KB
sketch.ino 4KB
LICENSE 11KB
Makefile 10KB
README.md 6KB
共 101 条
- 1
- 2
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Qt开发知识、经验总结 包括Qss,数据库,Excel,Model/View等
- IV数据.xlsx
- 一些深度学习中的小例子,适合新手学习使用
- foldcraftlauncher_262944.apk
- 珍藏多年的基于matlab实现潮流计算程序源代码集合,包含多个潮流计算程序.rar
- 使用FPGA实现串-并型乘法器
- 基于matlab实现针对基于双曲线定位的DV-Hop算法中误差误差出一种基于加权双曲线定位的DV-Hop改进算法.rar
- 基于matlab实现由遗传算法开发的整数规划,车辆调度问题.rar
- 电视家7.0(对电视配置要求高).apk
- 免费计算机毕业设计-基于JavaEE的医院病历管理系统设计与实现(包含论文+源码)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功