úΡb–¾½      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼Safe #Transform the computation inside a  StringErrorT.  ( f m) = f ( m) Noned *Information about source or destination db'the environment used to run the program runs the run action, then, runs the afterRun action no matter if the run action failed or succeededa ½ only variant of c; it runs the second action and, then the first action and returns the result of the second action4calls fail on the MonadFail logging an error messagethe variant of ! taking a log source as parameter,setup db environment and connect to database 1connect to database in an existing db environment!call withEnvConnect within a ¾0 environment containing database connnetion info"call ¿A within a ReaderT environment containing database connnetion info#–run an action in the current environment on each table name from the current schema, passing an accumulator value; returns the value of the accumulor$*an instance that deals only with source dbdatasource name user namepasswordLa function that gets the newly allocated environment and connection handlers handle to environmentdatasource name user namepasswordLa function that gets the newly allocated environment and connection handlers !"# !"%$#None<9&dump file header for version 1(Gthe maximum size of a data chunk; a field may have multiple data chunks)$the timestamp when the dump was made*)the dump description provided by the user+dump file format version-!the version size is dependent on 3Iinformation about the name of the field, the length, precision, type, etc=Cthe schema reffers to the information about each field in one table?database schema name@the name of the tableA)information about each field in the tableBmake a  schema. table_name qualified table nameJba chunk of data consists of the length of the binary data and a pointer to the memory of the dataL®indicates if a nullable field is Null or not Null; it is the first byte in encoded field value, only for fields that are nullable; non-nullable fields have no null indicatorOÆthere are 2 types of record indicators: * RI means that the following data is a new record in the current table; * EOT (end of table) means that there is no more data for the current tableJThe current table is defined by the previous SCHEMA block in the dump fileR=helper function to compute the store size in bytes of a valueSAthe version is written as an Word8 length followed by the versionTGthe header is written as an Word16 length followed by the header itselfUHthe schema is written as an Word32 length followed by the encoded schemaVwrite an RI record indicatorWwrite an EOT record indicatorXwrite a null indicatorYýwrite a chunk of binary data; the chunk has a length field followed by the binary data; the length field may be on 1, 2 or 4 bytes; the first parameter is the length in bytes of the length field, the second parameter is the length in bytes of the dataZ+encodes the memory buffer into a ByteString[Bdeclare type Size as instance of Eq class to be used in test cases\Tdeclare type Size as instance of Show class to be used in the tests and log messages(&'*)(+,34<;:98765=>A@?BJKLNMOQPRSTUVWXYZ2+,-&'()*C=>?@AB3456789:;<DI]OPQ^LMN_\[RSTUVWXJK`YZ&'()*+,3 456789:;<=>?@AJKLMNOPQNone<“cLedump field data parametersgdump file handlehtable select statementidata transfer bufferj the size of data transfer bufferkCbuffer to get null indicator or the actual size of transferred datal.the total data transferred prior to this fieldm5the number in the statement of the field to be dumpednthe description of the fieldo=environment for either single threaded or multi threaded dumpr1global environment for dumping tables in parallelt)the channel to publish the name of tablesuIwhen this is true, no more tables will be published on the tables channelvethe number of worker threads that are running; worker threads are the threads that actually dump dataw4provides synchronized access to the dump file handlexthe dump configurationyrshared environment allocated in the main thread; unixODBC has problem if the handle is allocated on another threadz.channel to call allocHandle on the main thread{restore database options}&ODBC data source name ~&user name &password €(schema to be restored &the dump file name ‚dump database options„&ODBC data source name …&user name †&password ‡&schema to be dumped ˆ&dump description supplied by the user ‰the dump file nameŠ+the number of threads to be run in parallel‹the global statistics mapŒ-the start time, used to compute the dump ratekeep statistics by statement handle; for each handle record the number of records dumped so far and the total size dumped so far4the maximum size of a chunk of variable length value"the buffer size used to copy files‘file buffering mode’4dump a schema from an ODBC database to a binary file“Edumps the database schema to the file represented by the given handle”"create the header of the dump file•3dumps all tables in a schema, on a given connection–;publish the tables to the chanel read by the worker threads—>monadic action to publish the table name on the tables channel˜ÿ$start the worker threads; each worker thread will dump data in a temporary file, then will append the contents of the temporary file to the contents of the dump file; the append is done synchronized with the other worker threads, so only one worker thread will append to the main dump file™start one worker threadš¼the worker thread; gets a table name from the tables channel and dumps the data in the temporary file; in the end, appends the temporary file contents to the end of the dump file contents›Ifinalizes the dump by copying the temporary file back into the dump fileœ,wait for worker threads to complete the workWcreates an IO action inside a STM monad to allocate a new handler in the current threadžBmake a handle alloc request to the main thread and wait for resultŸextract dumpConfig from a o structure %either directly alloc handle or call žU to alloc a handle deppending on it is run on a threaded or non threaded environment¡cworkarround for unixODBC bug that requires that all handles should be allocated on the main thread¢dumps a single table£logs the content of a  FieldInfo structure¤Mextract schema infromation from the database, using an existing db connection¥0extract the fields information from the database¦ transforms a À structure into a 3 structure§ndump the table records to the file, one by one; returns the (number of records, size in bytes) of dumped data¨bdumps the data of one record into the file; it returns the (number of records, total bytes dumped)©’monadic action that logs the data dumped until now; it uses a map that records the count of records and the size dumped for each statement handleªuncurried form of ( lotStatistics hstmt)«get the Á  StatiscsMap from the environment¬'get the start time from the environment­bdump data of a single field; adds the size of dumped data to the total size received as parameter®•ReaderT monadic action that dumps a field into the dump file; returns the total dump size, adding to the prior size the size in bytes of dumped data¯ÿVdumps a variable field length; the variable field length will be dumped in chunks each chunk having two fields: a length of the chunk and the actual data of the chunk. The length of the chunk will be encoded on one, two or four bytes, depending on the maximum chunk length and the maximum length of the field taken from the table's schema.°}the octet length of the chunk size; it is calculated based on the transfer buffer size and on the maxumum size of the field.±kdumps a chunk of data; increments the current size with the number of octets dumped and returns this value³€dumps a chunk of data for a non null field; increments the current size with the number of octets dumped and returns this value´ÿdumps a fixed length field; the buffer length of the field will be taken from the description of the field in the table's schema; the dumped data will only contain the data of the field; the first parameter represents the ODBC C data type of the data to be read from the databaseµ"dumps the data of a not null field¶qdumps a field of an unknown type; the field will be converted to SQL_C_CHAR and dumped as a string of characters·(create the select for dumping table data¸Tread the binary dump of a database and restores it in a destination ODBC data source¡connection handle schema name table nameTefnmlkjihgoqprszyxwvut{|€~}‚ƒŒ‹Š‰ˆ‡†…„Ž‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸XŽ‘‚ƒ„…†‡ˆ‰Š‹Œ¹{|}~€º’“”rstuvwxyz»•–—˜™š›œžopqŸ¼ ¡¢£¤¥¦§¨©ª«¬­efghijklmn®¯°±²³´µ¶·¸e fghijklmnopqrstuvwxyz{|}~€‚ ƒ„…†‡ˆ‰Š‹ŒÂ      !"#$%&'(()*+,-./01234456789:;<==>?@ABCDEFGHIIJKLMNOPQRSTUVWXYZ[\]^_`abccdefghijklmnoopqrstuvwwxyz{|}}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹·º»¼½¾¼½¿ÀÁÂÃ*transfer-db-0.3.1.2-HYnskV4z7GzBH269GxWHRqControl.Monad.Trans.StringErrorDatabase.TransferDB.Commons!Database.TransferDB.DumpDB.FormatDatabase.TransferDB.DumpDB StringErrorTrunStringErrorTmapStringErrorT$fMonadPlusStringErrorT$fMonadIOStringErrorT$fMonadFailStringErrorT$fMonadStringErrorT$fAlternativeStringErrorT$fApplicativeStringErrorT$fTraversableStringErrorT$fFoldableStringErrorT$fFunctorStringErrorT$fMonadTransStringErrorT HasDBInfo extractDBInfoDBInfodbi_Datasourcedbi_User dbi_Password dbi_SchemaProgramOptions po_Sourcepo_Destfinallyfinally'faillogfaillogSwithConnectionwithConnection'withEnvConnectionwithEnvConnection'connect' forAllTables$fHasDBInfoProgramOptions$fHasDBInfoDBInfoHeaderV1hv1_MaxChunkSize hv1_Timestamphv1_DescriptionVersionV1$fStoreVersion $fShowVersion $fOrdVersion $fEqVersion$fShowHeaderV1 $fEqHeaderV1 FieldInfoV1 fi_ColumnName fi_DataType fi_ColumnSizefi_BufferLengthfi_DecimalDigitsfi_NumPrecRadix fi_Nullablefi_OrdinalPositionSchemaV1schema_DBSchemaNameschema_TableName schema_Fieldsschema_QualifiedTableName$fStoreHeaderV1$fOrdFieldInfoV1$fShowFieldInfoV1$fEqFieldInfoV1$fShowSchemaV1 $fEqSchemaV1$fStoreFieldInfoV1Chunk NullIndicatorNullNotNullRecordIndicatorRIEOTsizeOf writeVersion writeHeader writeSchemawriteRIwriteEOTwriteNullIndicator writeChunk writePlainBuf$fEqSize $fShowSize$fStoreSchemaV1$fStoreRecordIndicator$fStoreNullIndicator $fStoreChunk$fShowRecordIndicator$fEqRecordIndicator$fShowNullIndicator$fEqNullIndicator DumpFieldSpec dmpfld_Handle dmpfld_HStmt dmpfld_Buf dmpfld_BufLendmpfld_LenOrInd dmpfld_Size dmpfld_Crt dmpfld_Field SingleOrMultiSingleThreaded MultiThreaded ThreadedDumpthreads_TablesChanthreads_AllTablesPublishedVarthreads_WorkerThreadsVarthreads_HandleVarthreads_Config threads_HEnvthreads_AllocHandleChan RestoreConfig restore_DSNrestore_UserNamerestore_Passwordrestore_Schemarestore_FilePath DumpConfigdump_DSN dump_UserName dump_Password dump_Schemadump_Description dump_FilePathdump_ParallelThreadsdump_StatisticsVardump_StartTime StatisticsMaplogsrc maxChunkSizebufSize fileBufferingdumphDump makeHeader dumpTables publishTables publishTablestartWorkerThreadsstartWorkerThread dumpThreadcopyTmpToDumpFilewaitForWorkToEnd allocHandleTallocHandleReq dumpConfig allocHandleSMcollectColumnsInfoSM dumpTabledebugFieldInfo extractSchemaextractSchemaFields makeFieldInfo dumpTableData dumpRecord logStatisticslogstats readSizesVar readStartTime dumpField dumpField'dumpVarLenFieldoctetLengthOfChunkSize dumpChunkdumpNullIndicator dumpChunk'dumpFixedFielddumpFixedField'dumpUnknownFieldType makeSelectSqlrestore$fHasDBInfoDumpConfig$fHasDBInfoRestoreConfig$fHasDBInfoThreadedDump$fHasDBInfoSingleOrMultitransformers-0.5.2.0Control.Monad.Trans.MaybeMaybeTControl.Monad.Trans.ReaderReaderT%sqlcli-0.2.0.1-A8p8ZvFmWhc6yT9yeFseCw SQL.CLI.Utilsconnect ColumnInfobase GHC.Conc.SyncTVar