[Mysql-cocoa-commits] CVS: SMySQL MCPConnection.m,1.1.2.7,1.1.2.8 MCPResult.m,1.1.2.6,1.1.2.7 MCPRes
Brought to you by:
sergecohen
From: Serge C. <ser...@us...> - 2002-08-22 21:02:48
|
Update of /cvsroot/mysql-cocoa/SMySQL In directory usw-pr-cvs1:/tmp/cvs-serv3329 Modified Files: Tag: version-2 MCPConnection.m MCPResult.m MCPResultPlus.m MCPFastQueries.m Log Message: Modifications of the comment for proper disply in the documentation. Serge Cohen; MySQL Cocoa Porject, 2002-08-22 Index: MCPConnection.m =================================================================== RCS file: /cvsroot/mysql-cocoa/SMySQL/Attic/MCPConnection.m,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** MCPConnection.m 23 Jul 2002 14:56:43 -0000 1.1.2.7 --- MCPConnection.m 22 Aug 2002 21:02:45 -0000 1.1.2.8 *************** *** 132,136 **** - (id) init /*" ! Initialise a MySQLConnection without making a connection, most likely useless, except with #{setConnectionOption:withArgument:}. "*/ { --- 132,136 ---- - (id) init /*" ! Initialise a MySQLConnection without making a connection, most likely useless, except with !{setConnectionOption:withArgument:}. "*/ { *************** *** 241,245 **** - (BOOL) connectWithLogin:(NSString *) login password:(NSString *) pass host:(NSString *) host port:(int) port socket:(NSString *) socket /*" ! The method used by #{initToHost:withLogin:password:usingPort:} and #{initToSocket:withLogin:password:}. Same information and use of the parameters: - login is the user name --- 241,245 ---- - (BOOL) connectWithLogin:(NSString *) login password:(NSString *) pass host:(NSString *) host port:(int) port socket:(NSString *) socket /*" ! The method used by !{initToHost:withLogin:password:usingPort:} and !{initToSocket:withLogin:password:}. Same information and use of the parameters: - login is the user name *************** *** 400,406 **** /*" Takes a query string and return an MCPResult object holding the result of the query. ! The returned MCPResult is not retained, the client is responsible for that (it's autoreleased before being returned). If no field are present in the result (like in an insert query), will return nil (!{difference from previous version implementation}). Though, if their is at least one field the result will be non nil (even if no row are selected). ! Note that if you want to use this method with binary data (in the query), you should use #{prepareBinaryData:} to include the binary data in the query string. Also if you want to include in your query a string containing any special character (\, ', " ...) then you should use #{prepareString}. "*/ { --- 400,406 ---- /*" Takes a query string and return an MCPResult object holding the result of the query. ! The returned MCPResult is not retained, the client is responsible for that (it's autoreleased before being returned). If no field are present in the result (like in an insert query), will return nil (#{difference from previous version implementation}). Though, if their is at least one field the result will be non nil (even if no row are selected). ! Note that if you want to use this method with binary data (in the query), you should use !{prepareBinaryData:} to include the binary data in the query string. Also if you want to include in your query a string containing any special character (\, ', " ...) then you should use !{prepareString}. "*/ { *************** *** 519,523 **** - (MCPResult *) listTables /*" ! Make sure a DB is selected (with !{selectDB} method) first. "*/ { --- 519,523 ---- - (MCPResult *) listTables /*" ! Make sure a DB is selected (with !{selectDB:} method) first. "*/ { *************** *** 695,699 **** /*" Kills the process with the given pid. ! The users needs the #{Process_priv} privilege. "*/ { --- 695,699 ---- /*" Kills the process with the given pid. ! The users needs the !{Process_priv} privilege. "*/ { *************** *** 707,711 **** - (void) disconnect /*" ! Disconnects a connected MCPConnection object; used by #{-dealloc} method. "*/ { --- 707,711 ---- - (void) disconnect /*" ! Disconnects a connected MCPConnection object; used by !{dealloc:} method. "*/ { Index: MCPResult.m =================================================================== RCS file: /cvsroot/mysql-cocoa/SMySQL/Attic/MCPResult.m,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** MCPResult.m 23 Jul 2002 14:56:43 -0000 1.1.2.6 --- MCPResult.m 22 Aug 2002 21:02:45 -0000 1.1.2.7 *************** *** 36,40 **** Hold the results of a query to a MySQL database server. It correspond to the MYSQL_RES structure of the C API, and to the statement handle of the PERL DBI/DBD. ! Uses the #{mysql_store_result()} function from the C API. This object is generated only by a MCPConnection object, in this way (see #{MCPConnection} documentation): --- 36,40 ---- Hold the results of a query to a MySQL database server. It correspond to the MYSQL_RES structure of the C API, and to the statement handle of the PERL DBI/DBD. ! Uses the !{mysql_store_result()} function from the C API. This object is generated only by a MCPConnection object, in this way (see #{MCPConnection} documentation): *************** *** 79,83 **** - (id) initWithMySQLPtr:(MYSQL *) mySQLPtr encoding:(NSStringEncoding) theEncoding /*" ! initialise a MCPResult, it is used internally by MCPConnection #{queryString:} method: the only proper way to get a running MCPResult object. "*/ { --- 79,83 ---- - (id) initWithMySQLPtr:(MYSQL *) mySQLPtr encoding:(NSStringEncoding) theEncoding /*" ! initialise a MCPResult, it is used internally by MCPConnection !{queryString:} method: the only proper way to get a running MCPResult object. "*/ { *************** *** 211,215 **** Return the next row of the result as a collection of type defined by aType (namely MCPTypeArray or MCPTypeDictionary). Each field of the row is made into a proper object to hold the info (NSNumber, NSString...). ! This method returned directly the !{mutable} object generated while going through all the columns "*/ { --- 211,215 ---- Return the next row of the result as a collection of type defined by aType (namely MCPTypeArray or MCPTypeDictionary). Each field of the row is made into a proper object to hold the info (NSNumber, NSString...). ! This method returned directly the #{mutable} object generated while going through all the columns "*/ { *************** *** 357,361 **** Return the next row of the result as an array, the index in select field order, the object a proper object for handling the information in the field (NSString, NSNumber ...). ! Just a !{typed} wrapper for method #{fetchRosAsType:} (with arg MCPTypeArray). --- 357,361 ---- Return the next row of the result as an array, the index in select field order, the object a proper object for handling the information in the field (NSString, NSNumber ...). ! Just a #{typed} wrapper for method !{fetchRosAsType:} (with arg MCPTypeArray). *************** *** 377,381 **** Return the next row of the result as a dictionary, the key being the field name, the object a proper object for handling the information in the field (NSString, NSNumber ...). ! Just a !{typed} wrapper for method #{fetchRosAsType:} (with arg MCPTypeDictionary). --- 377,381 ---- Return the next row of the result as a dictionary, the key being the field name, the object a proper object for handling the information in the field (NSString, NSNumber ...). ! Just a #{typed} wrapper for method !{fetchRosAsType:} (with arg MCPTypeDictionary). *************** *** 434,438 **** Return a collection of the fields's type. The type of collection is choosen by the aType variable (MCPTypeArray or MCPTypeDictionary). ! This method returned directly the !{mutable} object generated while going through all the columns "*/ { --- 434,438 ---- Return a collection of the fields's type. The type of collection is choosen by the aType variable (MCPTypeArray or MCPTypeDictionary). ! This method returned directly the #{mutable} object generated while going through all the columns "*/ { *************** *** 632,636 **** Return YES if the field (by name) with the given index is a BLOB. It should be used to discriminates between BLOBs and TEXTs. ! !{NOT YET IMPLEMENTED}, return YES for both BLOBs and TEXTs... "*/ { --- 632,636 ---- Return YES if the field (by name) with the given index is a BLOB. It should be used to discriminates between BLOBs and TEXTs. ! #{NOT YET IMPLEMENTED}, return YES for both BLOBs and TEXTs... "*/ { Index: MCPResultPlus.m =================================================================== RCS file: /cvsroot/mysql-cocoa/SMySQL/Attic/MCPResultPlus.m,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** MCPResultPlus.m 3 Jun 2002 13:39:24 -0000 1.1.2.2 --- MCPResultPlus.m 22 Aug 2002 21:02:45 -0000 1.1.2.3 *************** *** 65,69 **** - (NSArray *) fetchColWithName:(NSString *) aColName /*" ! The same as #{fetchColAtIndex:}, but the choice of the column is done by it's field name. Indeed it is just a wrapper to #{fetchColAtIndex}. "*/ { --- 65,69 ---- - (NSArray *) fetchColWithName:(NSString *) aColName /*" ! The same as !{fetchColAtIndex:}, but the choice of the column is done by it's field name. Indeed it is just a wrapper to !{fetchColAtIndex}. "*/ { *************** *** 90,100 **** Returns the complete result table in a 2D object, which type depends on aType: ! - MCPTypeArray : a NSArray of rows as NSArray, ! - MCPTypeDictionary : a NSArray of rows as NSDictionary, ! - MCPTypeFlippedArray : a NSArray of columns (as NSArray), ! - MCPTypeFlippedDictionary : a NSDictionary of columns (as NSArray) In any case the read position is restored at the end of the call (hence a fetchRow will get the same row wether this method is called before it or not). --- 90,100 ---- Returns the complete result table in a 2D object, which type depends on aType: ! - !{MCPTypeArray} : a NSArray of rows as NSArray, ! - !{MCPTypeDictionary} : a NSArray of rows as NSDictionary, ! - !{MCPTypeFlippedArray} : a NSArray of columns (as NSArray), ! - !{MCPTypeFlippedDictionary} : a NSDictionary of columns (as NSArray) In any case the read position is restored at the end of the call (hence a fetchRow will get the same row wether this method is called before it or not). Index: MCPFastQueries.m =================================================================== RCS file: /cvsroot/mysql-cocoa/SMySQL/Attic/MCPFastQueries.m,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** MCPFastQueries.m 12 Jun 2002 16:20:38 -0000 1.1.2.3 --- MCPFastQueries.m 22 Aug 2002 21:02:45 -0000 1.1.2.4 *************** *** 48,54 **** - (my_ulonglong) updateQuery:(NSString *) aQuery /*" ! Send the query aQuery to the server and retrieve the number of affected rows (should work with #{update}, #{delete}, #{insert} and #{select} type of queries). ! NB: This can also be used with a #{select} query if you are only interested in the number of row complying with the query; you'll get no chance to get the result from the query, except by sending the query again (with #{queryString:}) "*/ { --- 48,54 ---- - (my_ulonglong) updateQuery:(NSString *) aQuery /*" ! Send the query aQuery to the server and retrieve the number of affected rows (should work with !{update}, !{delete}, !{insert} and !{select} type of queries). ! NB: This can also be used with a !{select} query if you are only interested in the number of row complying with the query; you'll get no chance to get the result from the query, except by sending the query again (with !{queryString:}) "*/ { *************** *** 60,64 **** - (id) getFirstFieldFromQuery:(NSString *) aQuery /*" ! Get the first field of the first row of the result from the query (aQuery). "*/ { --- 60,64 ---- - (id) getFirstFieldFromQuery:(NSString *) aQuery /*" ! Get the first field of the first row of the result from the query (aQuery). Should return nil if no object at all are selected. "*/ { *************** *** 80,84 **** - (id) getAllRowsFromQuery:(NSString *) aQuery asType:(MCPReturnType) aType /*" ! Get a bidimensional table of the whole rows of the result from the query aQuery. The type of the result is choosen by aType, it can be (MCPTypeArray, MCPTypeDictionary, MCPTypeFlippedArray & MCPTypeFlippedDictionary). Description of the types can be found in method #{fetch2DResultAsType:}. "*/ { --- 80,84 ---- - (id) getAllRowsFromQuery:(NSString *) aQuery asType:(MCPReturnType) aType /*" ! Get a bidimensional table of the whole rows of the result from the query aQuery. The type of the result is choosen by aType, it can be (MCPTypeArray, MCPTypeDictionary, MCPTypeFlippedArray & MCPTypeFlippedDictionary). Description of the types can be found in method !{fetch2DResultAsType:}. "*/ { |