Skip to content

Commit

Permalink
Add Books sample
Browse files Browse the repository at this point in the history
  • Loading branch information
mmvergara committed Jun 18, 2024
1 parent 27ae5d9 commit 0e63a70
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions main.dart → books.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,46 +52,3 @@ class Books {
};
}
}

void main() {
print(Books.table_name);
// "books"
// ========================

final insert = Books.insert(
book_name: 'Book Name',
book_description: 'Description',
price: 2,
);
print(insert);
// {book_description: Description, book_name: Book Name}

final insert_many = [
Books.insert(
book_name: 'Book Name',
book_description: 'Description',
price: 2,
),
Books.insert(
book_name: 'Book Name 2',
created_at: DateTime.now().toString(),
price: 2,
),
];
print(insert_many);
// [
// {book_description: Description, book_name: Book Name},
// {book_name: Book Name 2, created_at: 2021-10-10 00:00:00.000}
// ]

final update = Books.update(
book_description: 'Description',
book_name: 'Book Name',
created_at:
DateTime.parse('2021-10-10').toString(), // Corrected to DateTime
id: 1,
);
print(update);
// {book_description: Description, book_name: Book Name, created_at: 2021-10-10 00:00:00.000, id: 1}
// ========================
}

0 comments on commit 0e63a70

Please sign in to comment.