FWH 17.05: Support for (x)Harbour PostGre libs

FWH 17.05: Support for (x)Harbour PostGre libs

Postby nageswaragunupudi » Thu Jun 08, 2017 8:26 am

Harbour and xHarbour provide hbpgsql and pgsql libraries for working with PostGre server. Some programmers are evincing interest in using them, but the lack of compatibilty with FWH has been an issue.

FWH 17.05 (revised build) provides an easy compatibility with XBrowse including inline editing and also provide some utility functions.

This does not require any changes to the (x)Harbour libraries.

Simply link your pgsql.lib (xHarbour) or hbpgsql.lib (Harbour) and implib libpq.lib along with your FWH application and go.

It is also very easy to create Unicode applications. Create database with utf8 character set and set FW_SetUnicode( .t. ). The application is now fully Unicode compatible.

Example:
Code: Select all  Expand view

   oServer   := TPQServer():New( host, db, user, password )
   if oServer:NetErr()
      ? oServer:ErrorMsg()
      QUIT
   endif

   if .not. oServer:TableExists( "customer" )
      FWPG_ImportFromDBF( oServer, "c:\fwh\samples\customer.dbf" )
   endif
   cSql  := "select * from customer"
   oQry  := oServer:Query( cSql )

   XBROWSER oQry FASTEDIT AUTOSORT TITLE "POSTGRE SQL"

   oQry:Destroy()
   oServer:Destroy()

return nil
 


Supported: Inline edit, autosort, incremental seek and wildseek, Edit dialog
Not supported: Incremental filters, appends.

There are many further improvements in FWH 17.06, including support for binary data (images) and more.

Example:
Code: Select all  Expand view

   if .not. oServer:TableExists( "customer" )
      FWPG_ImportFromDBF( oServer, "c:\fwh\samples\wwonders.dbf" )
   endif
   cSql  := "select * from wwonders"
   oQry  := oServer:Query( cSql )

   XBROWSER oQry FASTEDIT TITLE "POSTGRE SQL IMAGES" ;
      SETUP ( oBrw:lCanPaste := .t. )
 


Image

Test by copying an image file from file explorer and then clicking Ctrl-V on the image cell in xbrowse.
Replacing image: oCol:VarPut( memoread( <imagefile> ) )


Basic (hb)pgsql library supports only limited data types. FWH extends support for byinary (bytea) and timestamp datatypes.

Basic (hb)pgsql library also can not modify sql with aliased field names and join queries. FWH adds that support.

FWPG_Structure( oQry ) --> Extended structure info.

Users of FWH 17.05, if interested in testing the latest features, can obtain latest libs on request.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10208
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 21 guests