diver icon indicating copy to clipboard operation
diver copied to clipboard

implements 'scan' command

Open yjh0502 opened this issue 8 years ago • 0 comments

Implements 'scan' command which receives three paramaters

  • table: table name
  • options: Erlang proplist to specify scan options.
  • ref: Erlang reference to distinguish rows from multiple scans

API returns ok after starting scan asyncronously. It returns each rows with {Ref, row, [ColumnList]} messages for each cells. If there is an error occures during scan, it sends {Ref, error, Name, Msg} and terminates scan. If all rows are successfully returned, it sends {Ref, done} message.

note: This PR implements proof-of-concept mechanism of scan command. Any comments/reviews/feedbacks are welcome. Here's some ideas

  • {Ref, {error, Name, Msg}} might be better than {Ref, error, Name, Msg} because we can use single error handling function for both scan and get. Same for other messages.
  • It sends single message for each rows, and there might be performance problem when handling multiple small rows. {Ref, row, [Rows]} might be better
  • There are some redundent messages on row message. For example, we don't need to specify table name because we know it already.

yjh0502 avatar Jul 25 '16 13:07 yjh0502