{"action":"created","issue":{"url":"https://api.github.com/repos/praeclarum/sqlite-net/issues/773","repository_url":"https://api.github.com/repos/praeclarum/sqlite-net","labels_url":"https://api.github.com/repos/praeclarum/sqlite-net/issues/773/labels{/name}","comments_url":"https://api.github.com/repos/praeclarum/sqlite-net/issues/773/comments","events_url":"https://api.github.com/repos/praeclarum/sqlite-net/issues/773/events","html_url":"https://github.com/praeclarum/sqlite-net/issues/773","id":373103451,"node_id":"MDU6SXNzdWUzNzMxMDM0NTE=","number":773,"title":"SQLiteAsyncConnection not creating the database file Android","user":{"login":"IsmaelMendonca","id":9284248,"node_id":"MDQ6VXNlcjkyODQyNDg=","avatar_url":"https://avatars3.githubusercontent.com/u/9284248?v=4","gravatar_id":"","url":"https://api.github.com/users/IsmaelMendonca","html_url":"https://github.com/IsmaelMendonca","followers_url":"https://api.github.com/users/IsmaelMendonca/followers","following_url":"https://api.github.com/users/IsmaelMendonca/following{/other_user}","gists_url":"https://api.github.com/users/IsmaelMendonca/gists{/gist_id}","starred_url":"https://api.github.com/users/IsmaelMendonca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IsmaelMendonca/subscriptions","organizations_url":"https://api.github.com/users/IsmaelMendonca/orgs","repos_url":"https://api.github.com/users/IsmaelMendonca/repos","events_url":"https://api.github.com/users/IsmaelMendonca/events{/privacy}","received_events_url":"https://api.github.com/users/IsmaelMendonca/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-23T17:04:17Z","updated_at":"2018-10-25T09:48:55Z","closed_at":null,"author_association":"NONE","body":"Hello everyone, \r\n\r\nI am facing a mind-blowing issue with the SQLiteAsyncConnection from the sqlite-net-pcl package.\r\n\r\nI am creating a new Connection as usual using the class below:\r\n\r\n```\r\npublic sealed class AndroidStoreConnection : IConnectionContext\r\n    {\r\n        public AndroidStoreConnection()\r\n        {\r\n            Database = new SQLiteAsyncConnection(ConnectionPath(), storeDateTimeAsTicks: false);\r\n        }\r\n\r\n       public SQLiteAsyncConnection Database\r\n        {\r\n            get;\r\n            private set;\r\n        }\r\n\r\n        private string ConnectionPath()\r\n        {\r\n            string databaseName = \"FapMobile.db3\";\r\n            string documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); // Documents folde\r\n            return Path.Combine(documentsPath, databaseName);\r\n        }\r\n    }\r\n```\r\n\r\nThe problem is that starting a new instance of SQLiteAsyncConnection is not creating the db file into the Android's local system file.\r\n\r\nI already checked the permissions in the AndroidManifest and WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE is set up.\r\n\r\nNow the most strange behavior is that no exceptions has been raised, otherwise I could check what's going on.\r\n\r\nI am using the release 1.5.231.\r\n\r\nPlease can anyone help me? I am getting crazy with that!"},"comment":{"url":"https://api.github.com/repos/praeclarum/sqlite-net/issues/comments/432987629","html_url":"https://github.com/praeclarum/sqlite-net/issues/773#issuecomment-432987629","issue_url":"https://api.github.com/repos/praeclarum/sqlite-net/issues/773","id":432987629,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjk4NzYyOQ==","user":{"login":"Weldryn","id":29727554,"node_id":"MDQ6VXNlcjI5NzI3NTU0","avatar_url":"https://avatars0.githubusercontent.com/u/29727554?v=4","gravatar_id":"","url":"https://api.github.com/users/Weldryn","html_url":"https://github.com/Weldryn","followers_url":"https://api.github.com/users/Weldryn/followers","following_url":"https://api.github.com/users/Weldryn/following{/other_user}","gists_url":"https://api.github.com/users/Weldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/Weldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Weldryn/subscriptions","organizations_url":"https://api.github.com/users/Weldryn/orgs","repos_url":"https://api.github.com/users/Weldryn/repos","events_url":"https://api.github.com/users/Weldryn/events{/privacy}","received_events_url":"https://api.github.com/users/Weldryn/received_events","type":"User","site_admin":false},"created_at":"2018-10-25T09:48:55Z","updated_at":"2018-10-25T09:48:55Z","author_association":"NONE","body":"Just use the ctor with `CreateFlags` parameter. The flag you are looking for is `SQLiteOpenFlags.Create`.\r\nI am creating connections like that:\r\n\r\n    public bool DateTimeStoredAsInteger => true;\r\n\r\n    public SQLiteOpenFlags CreationFlags { get; } =\r\n        SQLiteOpenFlags.ReadWrite |\r\n        SQLiteOpenFlags.Create |\r\n        SQLiteOpenFlags.SharedCache |\r\n        SQLiteOpenFlags.FullMutex,;\r\n\r\n    private SQLiteAsyncConnection ConnectionFactory(string dbPath) =>\r\n        new SQLiteAsyncConnection(dbPath, CreationFlags, DateTimeStoredAsInteger);"}}
{"actor":{"display_login":"Weldryn"}}