summaryrefslogtreecommitdiff
path: root/src/include/xbsql.h
blob: 653096c34c1def89d5efca514765421628280fbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*  xbsql.h

XBase64 Software Library

Copyright (c) 1997,2003,2014,2022 Gary A Kunkel

The xb64 software library is covered under the terms of the GPL Version 3, 2007 license.

Email Contact:

    XDB-devel@lists.sourceforge.net
    XDB-users@lists.sourceforge.net

This class manages a list of open tables, open indices are connected to the open tables

*/


#ifndef __XB_XBSQL_H__
#define __XB_XBSQL_H__

#ifdef  CMAKE_COMPILER_IS_GNUCC
#pragma interface
#endif


#ifdef XB_SQL_SUPPORT

namespace xb{


struct XBDLLEXPORT xbSqlFld{
  char     cType;      // F - Database field
                       // L - Literal
                       // E - Expression
  xbInt16  iFldNo;     // Field number if db field
  xbExp *  pExp;       // If cType=E, pointer to parsed expression
  xbString sFldAlias;  // Alias name for query display
  xbSqlFld * Next;     // Next field in list
};




class XBDLLEXPORT xbSql : public xbSsv {
 public:
   // xbSql();
   xbSql( xbXBase *x );
   ~xbSql();

   xbInt16 ExecuteNonQuery( const xbString &sCmdLine );
   xbXBase *GetXbasePtr() const;

 protected:

 private:

   xbInt16  SqlAlterTable( const xbString &sCmdLine );
   xbInt16  SqlCreateTable( const xbString &sCmdLine );
   xbInt16  SqlDelete( const xbString &sCmdLine );
   xbInt16  SqlDropTable( const xbString &sCmdLine );

   #ifdef XB_INDEX_SUPPORT
   xbInt16  SqlCreateIndex( const xbString &sCmdLine );
   xbInt16  SqlDropIndex( const xbString &sCmdLine );
   #endif  // XB_INDEX_SUPPORT

// xbInt16  SqlCreateView( const xbString &sCmdLine );
// xbInt16  SqlDropView( const xbString &sCmdLine );
// xbInt16  SqlUpdate( const xbString &sCmdLine );
   xbInt16  SqlSelect( const xbString &sCmdLine );

   void     SqlHelp() const;
   xbInt16  SqlInsert( const xbString &sCmLine );
   xbInt16  SqlSet( const xbString &sCmdLine );
   xbInt16  SqlUse( const xbString &sCmdLine );

   xbXBase *xbase;
   xbUda   uda;

};

}        /* namespace xb    */
#endif   /* XB_SQL_SUPPORT  */
#endif   /* __XB_XBSQL_H__  */