ftp.nice.ch/pub/next/developer/resources/adaptors/MiniSQLEOFAdaptor.951211.s.gnutar.gz#/MiniSQLEOFAdaptor.95.12.11/MiniSQLAdaptorChannel.h

This is MiniSQLAdaptorChannel.h in view mode; [Download] [Up]

#import <eoaccess/eoaccess.h>

#include <msql.h>

@class MiniSQLAdaptor;
@class MiniSQLAdaptorContext;

@interface MiniSQLAdaptorChannel:EOAdaptorChannel
{
    int                 sock;

    m_row               cur;
    m_field            *curField;

    m_result           *result;

    BOOL 		isOpen;
    BOOL		isFetchInProgress;
    
    MiniSQLAdaptor	*adaptor;
    MiniSQLAdaptorContext *context;
    
    NSArray		*selectedAttributes;    
}

- initWithAdaptor:(MiniSQLAdaptor *)anAdaptor
    andContext:(MiniSQLAdaptorContext *)anAdaptorContext;
- (void)dealloc;

- (EOAdaptorContext *)adaptorContext;
    // Returns the EOAdaptorContext that controls transactions for the
    // channel.

- (BOOL)isOpen;
- (BOOL)openChannel;
- (void)closeChannel;
    // This method puts the channel and both its context and adaptor into a
    // state where they are ready to perform database operations.  Returns YES
    // on success, NO on failure for any reason.

- (BOOL)connectWithConnectionDictionary:(NSDictionary *)aDictionary;

- (NSArray *)describeEntities;
    // Returns an array of default entities constructed from meta data
    // returned by the database--for example, from the catalog or system
    // tables.

- (NSArray *)describeAttributesForEntity:(EOEntity *)entity;
    // Returns an array of default attributes or relationships for entity,
    // constructed from meta-data in the database server.  These methods don't
    // actually assign the attributes or relationships to the entity--you have
    // to do that yourself.  See EOEntity.h for descriptions of -addAttribute:
    // and -addRelationship:.

- (NSArray *)describeRelationshipsForEntity:(EOEntity *)entity;
    // Returns an array of default attributes or relationships for entity,
    // constructed from meta-data in the database server.  These methods don't
    // actually assign the attributes or relationships to the entity--you have
    // to do that yourself.  See EOEntity.h for descriptions of -addAttribute:
    // and -addRelationship:.  These methods are obsolete.

- (NSArray *)describeTableNames;
    // Reads and returns an array of table names from the database.  This
    // method in conjunction with describeModelWithTableNames: is used for
    // building a default model in EOModeler.

- (EOModel *)describeModelWithTableNames:(NSArray *)tableNames;
    // Constructs a default model out of the database's meta data.  It also
    // put the adaptor name and connection dictionary in the new model.  This
    // method obsoletes describeEntities, describeAttributes..., and
    // describeRelationships...

- (NSArray *)describeResults;
- setResultDescription:(NSArray *)properties;
    // Returns an array of attributes describing the properties available in
    // the current result set, as determined by -selectAttributes:...  or a
    // select statement evaluated by -evaluateExpression:.

- (BOOL)insertRow:(NSDictionary *)row forEntity:(EOEntity *)entity;
    // Inserts the attributes of row into the database.  row is an
    // NSDictionary whose keys are attribute names and whose values are the
    // values that will be inserted.  Returns YES on success, NO on failure
    // for any reason.

- (BOOL)updateRow:(NSDictionary *)row
    describedByQualifier:(EOQualifier *)qualifier; 
    // Updates the row described by qualifier so that its values are equal to
    // those in row.  row is an NSDictionary of attribute name/value pairs.
    // Returns YES on success, NO on failure for any reason.

- (BOOL)deleteRowsDescribedByQualifier:(EOQualifier *)qualifier;
    // Deletes the row described by the qualifier.  Returns YES on success,
    // NO on failure for any reason.

- (BOOL)selectAttributes:(NSArray *)attributes
    describedByQualifier:(EOQualifier *)qualifier
    fetchOrder:(NSArray *)fetchOrder
    lock:(BOOL)flag;
    // Selects the given attributes in rows matching the qualifier.  The
    // selected rows compose one or more result sets, each row of which will
    // be returned by subsequent -fetchAttributes:withZone: messages according
    // to the given fetchOrder (see EOAttributeOrdering.h).  If flag is YES,
    // the rows are locked if possible so that no other user can modify them.
    // Returns YES on success, NO on failure for any reason.

- (BOOL)evaluateExpression:(NSString *)expression;
    // Sends expression to the database server for evaluation.  Returns YES
    // if no error occurs, NO if any error occurs.

- (NSMutableDictionary *)fetchAttributes:(NSArray *)attributes 
    withZone:(NSZone *)zone;
    // Fetches the next row from the result set of the last
    // -selectAttributes:...  message and returns values for the attribute
    // names in attributes.  When there are no more rows in the current result
    // set, this method returns nil, and invokes the delegate method
    // -adaptorChannelDidChangeResultSet: if there are more results sets.
    // When there are no more rows or result sets, this method returns NO,
    // ends the fetch, and invokes -adaptorDidFinishFetching:.
    // -isFetchInProgress returns YES until the fetch is cancelled or until
    // this method exhausts all result sets and returns nil.

- (void)cancelFetch;
    // Clears the result set created by the last selectAttributes:...
    // message, and terminates the current fetch, so that
    // -isFetchInProgress returns NO.
@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.