⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ccql.cpp

📁 我们自己写的miniSQL代码
💻 CPP
字号:
// ccql.cpp : Defines the entry point for the console application.
//

//#include "BufferManager.h"
#include "API.h"
#include <memory.h>

int main()
{
	API api;
	BufferManager BM;
	BM.initialize(".//ccql.DBF");

	CatalogManager CM;
	CM.init(&BM);

	api.set_BufferManager(&BM);
	
	struct table_info ti;
	memcpy(ti.table_name , "test\0" ,20);
	ti.n_attribute = 1;
	memcpy(ti.attribute_name[0] , "attri\0",20);
	ti.type[0] = 111;
	ti.type_length[0] = 444;
	ti.ith_primary_key = 1;
	api.set_CatalogManger(&CM);

//	test create table
//	int i;
//	for (i = 0 ; i<1; i++)
//		api.create_table(&ti);				//test : past

	
//	struct table_info* ti1 = CM.get_table_info("test");			//test : past
	//test drop table
//	api.drop_table(ti.table_name);


	//test insert
//	char values[10][20];
//	api.insert("test\0",values);

	//test update
	struct st_where where_conditions;
	memcpy(where_conditions.attribute1[0] , "attri\0",20);
	memcpy(where_conditions.attribute2[0] , "old\0"  ,20);
	memcpy(where_conditions.operater[0], "=",2); 
	api.update("test\0","attri\0","UPDATE\0",&where_conditions);
	CM.finalize();
	BM.finalize();

	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -