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

Develop a DataStorageManager and implement data storage using SwiftData and SQLite. #17

Closed
tzopiz opened this issue Jul 22, 2024 · 0 comments · Fixed by #16
Closed

Develop a DataStorageManager and implement data storage using SwiftData and SQLite. #17

tzopiz opened this issue Jul 22, 2024 · 0 comments · Fixed by #16
Milestone

Comments

@tzopiz
Copy link
Owner

tzopiz commented Jul 22, 2024

Основное задание

Разработать DataStorageManager и pеализовать хранение данных с помощью SwiftData и SQLite.

  • ModelContainer хранится внутри SDStorageManager, инициализируется в момент создания SDStorageManager.
  • SDStorageManager содержит метод insert(_ item: Item) — добавить Item в бд.
  • SDStorageManager содержит метод fetch() — получить все сохраненные Item в бд.
  • SDStorageManager содержит метод delete(_ item: Item) — удалить Item в бд.
  • SDStorageManager содержит метод update(_ item: Item) — обновитьItem в бд.

Дополнительное задание 1:

  • Написать дополнительный метод fetch, чтобы SDStorageManager возвращал уже отсортированные и/или отфильтрованные [Item].
  • Ограничение: Инициализация Predicate и FetchDescriptor должна быть только внутри SDStorageManager / метода fetch.

Дополнительное задание 2:

  • Написать в SQLStorageManager дополнительные методы fetch/insert/delete/update (нейминг можно поменять согласно своему чувству прекрасного), которые будут осуществлять чтение/запись в файл из базы SQLite.
    • fetch — получение списка всех Item из бд.
    • insert — добавление в бд Item.
    • delete — удаление из бд Item.
    • update — обновить в бд Item.
  • Добавить в приложение возможность выбирать хранилище в настройках (системное приложение Настройки — MyTodoApp)
  • Подсказка: Settings Bundle (формат отображения настройки выбираете на свое усмотрение — тогл, выбор хранилища галочкой и т.д.).
  • Ограничение: без использования SwiftData.
@tzopiz tzopiz added this to the Backend milestone Jul 22, 2024
@tzopiz tzopiz changed the title Обновление функциональности приложения для поддержки новой реализации FileCache Updating the application functionality to support the new FileCache implementation Jul 22, 2024
@tzopiz tzopiz changed the title Updating the application functionality to support the new FileCache implementation Develop a DataStorageManager and implement data storage using SwiftData and SQLite. Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant