KitaroDB 2.0 SDK for WinRT\WinPhone
High Performance NoSQL for WinRT and Windows Phone
Using KitaroDB for WinRT and Windows Phone development

KitaroDB includes a library of classes and enumerations (in the KitaroDB namespace) that enable you to create and manage KitaroDB databases and to create, access, and modify key-value pairs or records in a KitaroDB database. Once you've installed KitaroDB and added a reference to the KitaroDB SDK in your Visual Studio project for Windows Store or Windows Phone development, you can use the KitaroDB SDK for WinRT to do the following. For more information, see KitaroDB basics.

▶  Create a KitaroDB database

You can create a key-value pair database or an intrusive-keyed database (a database that has structure-based records and that can have multiple indexes). To create a key-value pair database, simply use one of the DB.CreateAsync factory methods. To create an intrusive-keyed database, use the DBKey constructor to define the second and subsequent keys; then use the DB.CreateAsync factory method that accepts an array of keys. Note that you can create segmented keys, which enable you to sort on non-contiguous sections of a record and on different types. (The DBKeySegment constructor enables you to define segments.) See Creating a KitaroDB database for details.

▶  Open a KitaroDB database

To open an existing KitaroDB database, use DB.OpenAsync.  Note that you can open a KitaroDB database from a previous version of KitaroDB, but access will be read only.

▶  Insert a key-value pair or record

To insert a key-value pair or a record, use DB.InsertAsync. See Inserting a record or key-value pair for details.

▶  Use a cursor to filter, traverse, and lock records or key-value pairs

Cursors enable you to filter, traverse over, and lock key-value pairs and records. There are two types of cursor: discriminated and unfiltered. Use DB.SelectAsync to create a discriminated cursor, which limits subsequent cursor operations to key-value pairs or records that match the key passed to DB.SelectAsync. Use DB.SeekAsync to create an unfiltered cursor. With an unfiltered cursor, subsequent cursor operations apply to all key-value pairs or records in the database. When you open a cursor, you can set read/lock modes (which include modes for automatic unlocking and manual unlocking using DBCursor.UnlockGRFAAsync). And once a cursor has been opened, you can reposition it using DBCursor.MoveFirstAsync, DBCursor.MoveLastAsync, DBCursor.MoveNextAsync, DBCursor.MovePreviousAsync, or DBCursor.SeekAsync. See Using cursors for details.

▶  Read a key-value pair or record

There are two ways to read data. Either pass a key directly to DB.GetAsync, or use DBCursor.Get or DBCursor.GetString to get the value for the key-value pair or record at the current cursor position. See Reading, updating, deleting for more information.

▶  Update a key-value pair or record

There are two ways to update data. Either pass a key directly to DB.UpdateAsync, or use DBCursor.UpdateAsync to update the key-value pair or record at the current cursor position. See Reading, updating, deleting for more information.

▶  Delete a key-value pair or record

There are two ways to delete a key-value pair or record. Either pass a key directly to DB.DeleteAsync, or use DBCursor.DeleteAsync to delete the key-value pair or record at the current cursor position. See Reading, updating, deleting for more information.

▶  Handle errors

Errors are returned as COMExceptions. See Handling errors.

▶  Get information about keys, segments, GRFAs, and record length

To get all keys defined for an intrusive-keyed database, use DB.GetKeys.

To get the key for the current cursor location, use DBCursor.GetKey or DBCursor.GetKeyString.

To get information about a key, use DBKey properties (KeySize, KeyPosition, etc.).

To get information about a segment, use DBKeySegment properties (SegmentSize, SegmentPosition, etc.).

To get the global record file address (GRFA) for a record, use DBCursor.GetGFRA. (See KitaroDB basics for more information.)

To retrieve the maximum record length for a database, use the DB.MaxRecordLength property.

▶  Rename or delete a KitaroDB database

To rename a KitaroDB database, including both the index and data files for the database, use the DB.RenameAsync method.

To delete a KitaroDB database, use the DB.PurgeAsync method. This deletes the index file and data file for the database.