GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
Dbo
Versions
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
8
const
char
*
GCW::Dbo::Versions::s_tableName
=
"versions"
;
9
10
const
Wt::WFormModel::Field
GCW::Dbo::Versions::Field::table_name
=
"table_name"
;
// text(50) PRIMARY KEY NOT NULL,
11
const
Wt::WFormModel::Field
GCW::Dbo::Versions::Field::table_version
=
"table_version"
;
// integer NOT NULL
12
13
auto
14
GCW::Dbo::Versions::
15
load
(
const
std::string & _table_name )->
GCW::Dbo::Versions::Item::Ptr
16
{
17
GCW::Dbo::Versions::Item::Ptr
retVal;
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
Versions.h
GCW::Dbo::Versions::Item
Versions Class.
Definition
Dbo/Versions/Item.h:70
Wt::Dbo::Transaction
Wt::Dbo::ptr< Item >
Wt::WFormModel::Field
const char * Field
GCW::Dbo::Versions::Field::table_name
const Wt::WFormModel::Field table_name
Definition
Versions.cpp:10
GCW::Dbo::Versions::Field::table_version
const Wt::WFormModel::Field table_version
Definition
Versions.cpp:11
GCW::Dbo::Versions::load
auto load(const std::string &_table_name) -> Item::Ptr
Load Version by Table Name.
Definition
Versions.cpp:15
GCW::Dbo::Versions::s_tableName
const char * s_tableName
Definition
Versions.cpp:8
GCW::app
App * app()
Definition
App.cpp:75
Generated on Sat Sep 13 2025 08:48:27 for GnuCashew ~ Web Application compatible with GnuCash sql data files. by
1.9.8