### Method

# EDataBook BookSqlite cursor_new

since: 3.12

#### Declaration [src]

    EbSqlCursor*
    e_book_sqlite_cursor_new (
      EBookSqlite* ebsql,
      const gchar* sexp,
      const EContactField* sort_fields,
      const EBookCursorSortType* sort_types,
      guint n_sort_fields,
      GError** error
    )

#### Description [src]

Creates a new `EbSqlCursor`.

The cursor should be freed with e_book_sqlite_cursor_free().

Available since: 3.12

This method is not directly available to language bindings.

#### Parameters

`sexp`

  Type: `const gchar*`

  Search expression; use `NULL` or an empty string to get all stored contacts.

  The argument can be `NULL`.
  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`sort_fields`

  Type: An array of `EContactField`

  An array of `EContactFields` as sort keys in order of priority.

  The length of the array is specified in the `n_sort_fields` argument.
  The data is owned by the caller of the method.

`sort_types`

  Type: An array of `EBookCursorSortType`

  An array of `EBookCursorSortTypes`, one for each field in `sort_fields`.

  The length of the array is specified in the `n_sort_fields` argument.
  The data is owned by the caller of the method.

`n_sort_fields`

  Type: `guint`

  The number of fields to sort results by.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `EbSqlCursor`

A newly created `EbSqlCursor`.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.