|
GEOS SDK TechDocs|
|
|
1 Introduction |
3 Deleting a DataStore
DataStoreCreate()
To create a new datastore, specify its attributes in a
DataStoreCreateParams
structure and call
DataStoreCreate()
.
typedef struct {
TCHAR *DSCP_name;
DataStoreFlags DSCP_flags;
FieldDescriptor *DSCP_keyList;
word DSCP_keyCount;
optr DSCP_notifObject;
DataStoreOpenFlags DSCP_openFlags;
} DataStoreCreateParams;
-
DSCP
_name -
Name of the datastore. Used when opening, deleting or renaming a datastore. Any legal filename is acceptable.
-
DSCP
_flags -
Only the following flags may be passed:
-
DSF_PRIVATE
Restricts access to the datastore to the owner only (
i.e.
, the application that created the datastore).
-
DSF_TIMESTAMP
Creates a timestamp field and makes it the first field of the datastore. This field is updated whenver a record is modified.
-
DSF_NO_PRIMARY_KEY
Specifies that the datastore will contain no key field. When passing this flag, you must set DSCP
_keyCount
to zero.
-
DSCP
_keyList -
Pointer to an array of fields that make up the key. The term "key field" is not used in the relational database sense. In a datastore, the key field does not uniquely identify a record; it simply determines storage order of the records if no callback is passed in
DataStoreSaveRecord()
(see "Adding Records," Adding Records for a complete discussion of storage order).
typedef struct {
FieldData FD_data;
TCHAR *FD_name;
} FieldDescriptor;
typedef struct {
FieldType FD_type;
FieldCategory FD_category;
FieldFlags CFD_flags;
} FieldData;
-
Fields of
FieldType
DSFT_TIMESTAMP and DSFT_BINARY may not be part of the key and the only
FieldFlag
which may be passed is FF_DESCENDING (default sort order is ascending).
-
Once you create a datastore, you cannot redefine the key later (by adding, deleting or changing the key field(s)) nor can you add a key to a datastore that was created without one.
-
DSCP
_keyCount -
Number of fields that make up the primary key.If you pass zero, then you must pass DSF_NO_PRIMARY_KEY in
DSCP_flags
.
-
DSCP
_notifyObject -
Object to be notified when changes to the datastore occur. This object will receive MSG_META_NOTIFY_WITH_DATA_BLOCK which will pass a
DataStoreChangeNotification
structure. See the GCN chapter.
Passing NullOptr means no object will receive notification.
-
DSCP
_openFlags -
Passing zero allows multiple applications to open the datastore simultaneously. Passing DSOF_EXCLUSIVE gives exclusive access to the calling application.
Adding Fields
Adding Records
Deleting Records
Deleting Fields
|
GEOS SDK TechDocs|
|
|
1 Introduction |
3 Deleting a DataStore