1

I am converting a working Android Studio app to the KMM Environment. At this point I have a very simple KMM framework. Once I added SQLDelight to the common packages I started getting the following error on my build. I have checked every example I could find and can not see what is wrong. Please help if you can?

This is the error message:

Generation failed; see the generator error output for details Task :shared:generateAndroidDebugPicturesDBInterface FAILED WARN: The registry key 'psi.track.invalidation' accessed, but not loaded yet

WARN: The registry key 'psi.incremental.reparse.depth.limit' accessed, but not loaded yet

WARN: The registry key 'ide.hide.excluded.files' accessed, but not loaded yet

C:/Users/pagel/AndroidStudioProjects/DailyNasa/shared/src/commonMain/sqldelight/com/pagetyler/shared/cache/Pictures.sq line 17:10 - '{' expected, got ':' 17 :

                           **^**

Execution failed for task ':shared:generateAndroidDebugPicturesDBInterface'. Generation failed; see the generator error output for details. `

It is failing on processing the .sq files that it should be using to generate the tables and queries. When it encounters the very first ":" in the file after the first query label is specified. Here is the .sq file script. The build fails after getAllPict: that is the first query label specified.

This is the .sq File

CREATE TABLE Daily_Pictures (
    "date_loaded"       TEXT NOT NULL PRIMARY KEY,
    "copyright"         TEXT NOT NULL,
    "image_explanation" TEXT NOT NULL,
    "hd_url_string"     TEXT NOT NULL,
    "media_type"        TEXT NOT NULL,
    "service_version"   TEXT NOT NULL,
    "picture_title"     TEXT NOT NULL,
    "picture_url_string"    TEXT NOT NULL,
    "picture_file_reg"  TEXT NOT NULL,
    "picture_file_hd"   TEXT NOT NULL,
    "picture_On_DB" INTEGER AS Boolean DEFAULT NULL,
    "picture_Favorite"  INTEGER AS Boolean DEFAULT NULL,
    "storeDate" TEXT NOT NULL DEFAULT 0
);

getAllPict:
select  dp.date_loaded, dp.copyright, dp.hd_url_string, dp.image_explanation, dp.media_type, 
        dp.picture_Favorite, dp.picture_On_DB, dp.picture_file_hd, dp.picture_file_reg, 
        dp.picture_title, dp.picture_url_string, dp.service_version, dp.storeDate
  from  "Daily_Pictures" dp;}
    
insertPic:
INSERT OR REPLACE INTO Daily_Pictures(date_loaded, copyright, image_explanation, hd_url_string, 
           media_type, service_version, picture_title, picture_url_string, picture_file_reg, 
           picture_file_hd, picture_On_DB, picture_Favorite, storeDate)
    Values(?,?,?,?,?,?,?,?,?,?,?,?,?);
                            
updatePic:
INSERT OR REPLACE INTO Daily_Pictures(date_loaded, copyright, image_explanation, hd_url_string, 
          media_type, service_version, picture_title, picture_url_string, picture_file_reg, 
          picture_file_hd, picture_On_DB, picture_Favorite, storeDate)
    Values(?,?,?,?,?,?,?,?,?,?,?,?,?);
                            
getPicByKey:
    SELECT * from Daily_Pictures where date_loaded = ?;

delAllPict:
    DELETE FROM Daily_Pictures;

delPictByKey:
    DELETE FROM Daily_Pictures where date_loaded = ?;

cleanUpDB:
    delete from Daily_Pictures where storeDate < ? and (not picture_Favorite and not picture_On_DB);

cleanUpFavorites:
    delete from Daily_Pictures where storeDate < ? and (picture_Favorite);

New version up to first error. updated 2020-3-5 same results

    getAllPict:
    select  dp.date_loaded, dp.copyright, dp.hd_url_string,  dp.image_explanation, dp.media_type, dp.picture_Favorite, dp.picture_On_DB,
        dp.picture_file_hd, dp.picture_file_reg, dp.picture_title, dp.picture_url_string, dp.service_version, dp.storeDate
    from  "Daily_Pictures" dp;
BroPage
  • 129
  • 10
  • Previously working programs are also having the same problem on this build. like the `kmm-networking-and-data-storage-final` example program that has had no change and will not compile now in `Android Studio 4.1.2 Build #AI-201.8743.12.41.7042882, built on December 19, 2020 Runtime version: 1.8.0_242-release-1644-b01 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0 GC: ParNew, ConcurrentMarkSweep Memory: 4029M Cores: 8 ` – BroPage Mar 05 '21 at 16:06

1 Answers1

0

theres a curly brace here that shouldn't be there:

from "Daily_Pictures" dp;}

Anstrong
  • 734
  • 3
  • 7
  • Thanks Anstrong, But that come from me trying to correct the issue. The message keeps saying that it is expecting a "{" at the point where it finds the ":". I tried different ways of providing "{}" to see if that would correct the problem. I forgot to remove that final brace. I did remove it and got the same results. – BroPage Mar 05 '21 at 14:59
  • 1
    the `select` and `from` might need to be capitalized - `SELECT`/`FROM` – Anstrong Mar 05 '21 at 18:11
  • **OMG!** That is it. In all my years of working with SQL this is the first time that it is **CASE Sensitive**. It is also inconsistent with some key words being upper case and others like **Boolean** not. Thanks Anstrong. – BroPage Mar 05 '21 at 19:18