mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
syncing uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@1269 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e18e7bf9de
commit
4630376824
5 changed files with 66 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
description "\377B0,0,255";
|
description "\377B";
|
||||||
|
|
||||||
uses
|
uses
|
||||||
CtrlLib,
|
CtrlLib,
|
||||||
|
|
|
||||||
5
uppdev/sqlite3sch/init
Normal file
5
uppdev/sqlite3sch/init
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#ifndef _sqlite3sch_icpp_init_stub
|
||||||
|
#define _sqlite3sch_icpp_init_stub
|
||||||
|
#include "Core/init"
|
||||||
|
#include "plugin\sqlite3/init"
|
||||||
|
#endif
|
||||||
14
uppdev/sqlite3sch/schema.sch
Normal file
14
uppdev/sqlite3sch/schema.sch
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
TABLE_(SUPPLIER)
|
||||||
|
INT_ (ID) PRIMARY_KEY AUTO_INCREMENT
|
||||||
|
STRING_ (NAME, 80) NOT_NULL SQLDEFAULT("")
|
||||||
|
STRING_ (ADDRESS1, 128)
|
||||||
|
STRING_ (ADDRESS2, 128)
|
||||||
|
STRING_ (CITY, 128)
|
||||||
|
STRING_ (STATE, 80)
|
||||||
|
STRING_ (POSTAL_CODE, 24)
|
||||||
|
STRING_ (PRIMARY_PHONE, 35)
|
||||||
|
STRING_ (SECONDARY_PHONE, 35)
|
||||||
|
STRING_ (EMAIL, 128)
|
||||||
|
STRING_ (WEB_ADDRESS, 500)
|
||||||
|
BLOB_ (DESCRIPTION)
|
||||||
|
END_TABLE
|
||||||
35
uppdev/sqlite3sch/sqlite3sch.cpp
Normal file
35
uppdev/sqlite3sch/sqlite3sch.cpp
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
#include <Core/Core.h>
|
||||||
|
#include <plugin/sqlite3/Sqlite3.h>
|
||||||
|
|
||||||
|
using namespace Upp;
|
||||||
|
|
||||||
|
#define SCHEMADIALECT <plugin/sqlite3/Sqlite3Schema.h>
|
||||||
|
#define MODEL <sqlite3sch/schema.sch>
|
||||||
|
#include "Sql/sch_header.h"
|
||||||
|
|
||||||
|
#include <Sql/sch_schema.h>
|
||||||
|
#include <Sql/sch_source.h>
|
||||||
|
|
||||||
|
CONSOLE_APP_MAIN
|
||||||
|
{
|
||||||
|
Sqlite3Session sqlite3;
|
||||||
|
if(!sqlite3.Open(ConfigFile("simple.db"))) {
|
||||||
|
Cout() << "Can't create or open database file\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
sqlite3.SetTrace();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
SQL = sqlite3;
|
||||||
|
|
||||||
|
SQL.Execute("drop table SUPPLIER");
|
||||||
|
|
||||||
|
SqlSchema sch(SQLITE3);
|
||||||
|
All_Tables(sch);
|
||||||
|
SqlPerformScript(sch.Upgrade());
|
||||||
|
SqlPerformScript(sch.Attributes());
|
||||||
|
SQL.ClearError();
|
||||||
|
}
|
||||||
11
uppdev/sqlite3sch/sqlite3sch.upp
Normal file
11
uppdev/sqlite3sch/sqlite3sch.upp
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
uses
|
||||||
|
Core,
|
||||||
|
plugin\sqlite3;
|
||||||
|
|
||||||
|
file
|
||||||
|
sqlite3sch.cpp,
|
||||||
|
schema.sch;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "";
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue