
import(methods)
import(DBI)
importFrom("utils", "count.fields", "read.table")

useDynLib(RPostgreSQL, .registration = TRUE)

## Classes
exportClasses(
   dbObjectId,
   PostgreSQLObject,
   PostgreSQLDriver,
   PostgreSQLConnection,
   PostgreSQLResult
)

## Methods/Generics
exportMethods(
   coerce,
   dbApply,
   dbBegin,
   dbCallProc,
   dbClearResult,
   dbColumnInfo,
   dbCommit,
   dbConnect,
   dbDataType,
   dbDisconnect,
#   dbEscapeStrings,
   dbExistsTable,
   dbGetException,
   dbGetInfo,
   dbGetQuery,
   dbGetRowCount,
   dbGetRowsAffected,
   dbGetStatement,
   dbHasCompleted,
   dbListConnections,
   dbListFields,
   dbListResults,
   dbListTables,
#   dbMoreResults,
#   dbNextResult,
   dbReadTable,
   dbRemoveTable,
   dbRollback,
   dbSendQuery,
   dbUnloadDriver,
   dbWriteTable,
   fetch,
   format,
   initialize,
   isSQLKeyword,
   make.db.names,
   show,
   SQLKeywords,
   summary
)

## regular functions (most of these will be made private)
export(
  PostgreSQL,
  postgresqlBuildTableDefinition,
  isPostgresqlIdCurrent,
#  .PostgreSQLKeywords,
  postgresqlInitDriver,
  postgresqlCloseDriver,
  postgresqlDescribeDriver,
  postgresqlDriverInfo,
  postgresqlNewConnection,
  postgresqlCloneConnection,
  postgresqlDescribeConnection,
  postgresqlConnectionInfo,
  postgresqlCloseConnection,
  postgresqlExecStatement,
  postgresqlpqExec,
  postgresqlCopyIn,
  postgresqlCopyInDataframe,
  postgresqlgetResult,
  postgresqlQuickSQL,
  postgresqlDBApply,
  postgresqlFetch,
  postgresqlResultInfo,
  postgresqlDescribeResult,
  postgresqlDescribeFields,
  postgresqlCloseResult,
  postgresqlImportFile,
  postgresqlReadTable,
  postgresqlWriteTable,
  postgresqlEscapeStrings,
  postgresqlEscapeBytea,
  postgresqlUnescapeBytea,
  postgresqlDataType,
  postgresqlQuoteId,
  postgresqlTableRef
)

## constants
#export(
#   CLIENT_LONG_PASSWORD,
#   CLIENT_FOUND_ROWS,
#   CLIENT_LONG_FLAG,
#   CLIENT_CONNECT_WITH_DB,
#   CLIENT_NO_SCHEMA,
#   CLIENT_COMPRESS,
#   CLIENT_ODBC,
#   CLIENT_LOCAL_FILES,
#   CLIENT_IGNORE_SPACE,
#   CLIENT_PROTOCOL_41,
#   CLIENT_INTERACTIVE,
#   CLIENT_SSL,
#   CLIENT_IGNORE_SIGPIPE,
#   CLIENT_TRANSACTIONS,
#   CLIENT_RESERVED,
#   CLIENT_SECURE_CONNECTION,
#   CLIENT_MULTI_STATEMENTS,
#   CLIENT_MULTI_RESULTS
#)
