From 0e63a70c503209030a6da6de57e89bbd92e1034a Mon Sep 17 00:00:00 2001 From: mmvergara Date: Wed, 19 Jun 2024 05:02:09 +0800 Subject: [PATCH] Add Books sample --- main.dart => books.dart | 43 ----------------------------------------- 1 file changed, 43 deletions(-) rename main.dart => books.dart (54%) diff --git a/main.dart b/books.dart similarity index 54% rename from main.dart rename to books.dart index b2fdd8a..1523357 100644 --- a/main.dart +++ b/books.dart @@ -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} - // ======================== -}