Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add schema to cursors #194

Closed
wants to merge 4 commits into from
Closed

Add schema to cursors #194

wants to merge 4 commits into from

Conversation

tshemsedinov
Copy link
Member

@tshemsedinov tshemsedinov commented Sep 3, 2018

Here is an example of fetch callback arguments: err, data, cursor

{ err: null,
  data:
   [ { Name: 'Russian', Locale: 'ru' },
     { Name: 'Ukrainian', Locale: 'uk' } ],
  cursor:
   MemoryCursor {
     parent:
      MemoryCursor {
        parent: null,
        provider: null,
        dataset:
         [ { Name: 'English', Locale: 'en' },
           { Name: 'Ukrainian', Locale: 'uk' },
           { Name: 'Russian', Locale: 'ru' } ],
        children: [],
        jsql: [],
        schema:
         Dictionary {
           Name:
            { domain: 'Nomen', lookup: true, required: true, unique: true },
           Locale: { domain: 'Nomen', required: true, unique: true } },
        indices: {} },
     provider: null,
     dataset: undefined,
     children: [],
     jsql: [],
     schema:
      Dictionary {
        Name:
         { domain: 'Nomen', lookup: true, required: true, unique: true },
        Locale: { domain: 'Nomen', required: true, unique: true } },
     indices: {} } }

- Attach schema: `cursor.metadata(schema)`
- Read schema: `cursor.schema`
- Fetch with schema: `cursor.fetch((err, dataset, schema) => {})`
tshemsedinov added a commit that referenced this pull request Sep 3, 2018
- Attach schema: `cursor.metadata(schema)`
- Read schema: `cursor.schema`
- Fetch with schema: `cursor.fetch((err, dataset, schema) => {})`

PR-URL: #194
tshemsedinov added a commit that referenced this pull request Sep 3, 2018
@tshemsedinov
Copy link
Member Author

Landed in 6fd0962 and c84a8bb

@tshemsedinov tshemsedinov deleted the memory-stub branch September 5, 2018 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant