GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
Versions.cpp
Go to the documentation of this file.
1#line 2 "src/Dbo/Versions/Versions.cpp"
2
3#include "../App.h"
4#include "../Glb/Core.h"
5
6#include "Versions.h"
7
8const char * GCW::Dbo::Versions::s_tableName = "versions";
9
10const Wt::WFormModel::Field GCW::Dbo::Versions::Field::table_name = "table_name" ; // text(50) PRIMARY KEY NOT NULL,
11const Wt::WFormModel::Field GCW::Dbo::Versions::Field::table_version = "table_version" ; // integer NOT NULL
12
13auto
15load( const std::string & _table_name )-> GCW::Dbo::Versions::Item::Ptr
16{
18
19 if( _table_name != "" )
20 {
21
22 Wt::Dbo::Transaction t( GCW::app()-> gnucashew_session() );
23
24 try
25 {
26 retVal =
27 GCW::app()-> gnucashew_session().find< GCW::Dbo::Versions::Item >()
28 .where( "table_name = ?" )
29 .bind( _table_name )
30 .resultValue()
31 ;
32 }
33 catch( std::exception & e )
34 {
35 std::cout << __FILE__ << ":" << __LINE__ << " " << e.what() << std::endl;
36 }
37 }
38
39 return retVal;
40
41} // endload( const std::string & _guid )-> GCW::Dbo::Versions::Item::Ptr
42
43
44
const char * Field
const Wt::WFormModel::Field table_name
Definition Versions.cpp:10
const Wt::WFormModel::Field table_version
Definition Versions.cpp:11
auto load(const std::string &_table_name) -> Item::Ptr
Load Version by Table Name.
Definition Versions.cpp:15
const char * s_tableName
Definition Versions.cpp:8
App * app()
Definition App.cpp:75