zim32 / mysql.dart

MySQL client for Dart written in Dart
BSD 3-Clause "New" or "Revised" License
67 stars 18 forks source link

How to do Resultset to object #35

Closed yagizdo closed 2 years ago

yagizdo commented 2 years ago

Hi.

Thank you for making such a package. I created a test database myself, there are books in it. When I say Result.assoc, I can see all my books on the console. But no matter what I tried, I could not access those books one by one. I want to list the books I got from my database on the screen. No matter what I tried I couldn't :/ How can I convert to object or at least access only every row :/

Screen Shot 2022-08-08 at 00 55 16

zim32 commented 2 years ago

Hi. You can check example directory in the root of this package.

zim32 commented 2 years ago

Assos returns you object you need. This is Map so you need somehow map it to your DTO, or you can access columns one by one and convert using this approach

zim32 commented 2 years ago

This is low level library, so such things as converting data into dto is not covered by this library

yagizdo commented 2 years ago

I did it this way. Thank you too for your answer.

image