Guinsoo
GitHub
  • Welcome to Guinsoo!
  • Guides
    • Introduction
    • Quickstart
    • Features
    • Installation
    • Tutorial
      • Using the Server
      • Clients for Guinsoo
        • NodeJS
        • Go
        • Rust
        • C++
        • Python
        • Java
      • Web UI for Guinsoo
      • The Shell Tool
      • CSV Support
    • Security
    • Performance
    • Advanced
  • Reference
    • Commands
    • Functions
    • Aggregate
    • Window
    • Data Types
    • SQL Grammar
    • System Table
  • Support
    • FAQ
  • Appendix
    • Links
    • Architecture
    • Contribute
    • License
Powered by GitBook
On this page

Was this helpful?

  1. Guides
  2. Tutorial
  3. Clients for Guinsoo

C++

The database was created as MODE=PostgreSQL.

MySQL or others dialogs can be created.

#include <iostream>
#include <pqxx/pqxx> 

using namespace std;
using namespace pqxx;

int main(int argc, char* argv[]) {
   try {
      connection C("dbname = xxx user = sa password = sa \
      hostaddr = 127.0.0.1 port = 5435");
      if (C.is_open()) {
         cout << "Opened database successfully: " << C.dbname() << endl;
      } else {
         cout << "Can't open database" << endl;
         return 1;
      }
      C.disconnect ();
   } catch (const std::exception &e) {
      cerr << e.what() << std::endl;
      return 1;
   }
}

PreviousRustNextPython

Last updated 2 years ago

Was this helpful?