-
Notifications
You must be signed in to change notification settings - Fork 380
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
Builder giving undexpected error/warning .drfit
file
#3364
Comments
Regarding the "could not read tables" error, are you listing a table that was defined from a
This is probably due to a trailing comma in the table definition, which is not allowed.
This one is kind of interesting, can you post the The error about a table being unknown is probably due to a missing I also recommend checking the datetime errors - if you have the option to store datetimes as text enabled, it's better to do |
Thank you, while most of issues seems to have resolved, still few persist.
Below are the tables import 'package:xxx/common/enum/app_level_common_enum.dart';
CREATE TABLE IF NOT EXISTS one_tap_login_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
email TEXT,
password TEXT,
fullName TEXT,
avatar_image_local_path TEXT,
last_logged_in_auth_type ENUM(AuthType)
);
|
Could you check whether there's a typo or something in the drift file that might prevent us from resolving that import? If there isn't, do you have a special build configuration or something that might make that file inaccessible to drift? Are there any syntax errors related to |
It seems there is no syntax error. Also, the path of the And we are importing in the import 'package:mytrailpals/common/enum/app_level_common_enum.dart';
CREATE TABLE IF NOT EXISTS one_tap_login_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
email TEXT,
password TEXT,
fullName TEXT,
avatar_image_local_path TEXT,
last_logged_in_auth_type ENUM(AuthType)
);
Yaa, it seems everything is valid again sharing the ------------- import table-------------
import 'package:mytrailpals/config/app_db/schema/file_metadata.drift';
------------- import ends -------------
CREATE TABLE IF NOT EXISTS image_metadata_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
image_id TEXT NOT NULL UNIQUE,
file_md5_hash TEXT NOT NULL UNIQUE,
blur_hash VARCHAR(255) NOT NULL,
parent_image_id TEXT,
created_at DATETIME NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
updated_at DATETIME NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
FOREIGN KEY(parent_image_id) REFERENCES image_metadata_table(image_id)
ON UPDATE CASCADE
ON DELETE SET NULL,
FOREIGN KEY (file_md5_hash) REFERENCES file_metadata_table(md5_hash)
ON DELETE CASCADE
ON UPDATE CASCADE
);
-- Index
CREATE INDEX IF NOT EXISTS idx_image_metadata_file_md5_hash ON image_metadata_table(file_md5_hash);
CREATE INDEX IF NOT EXISTS idx_image_metadata_image_id ON image_metadata_table(image_id);
-- Trigger
CREATE TRIGGER IF NOT EXISTS image_metadata_updated
AFTER UPDATE ON image_metadata_table
FOR EACH ROW
BEGIN
UPDATE image_metadata_table SET updated_at = (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) WHERE id = OLD.id;
END;
-- Query
insertReplaceImageMetadata(
REQUIRED :image_id AS TEXT,
REQUIRED :file_md5_hash AS TEXT,
REQUIRED :blur_hash AS TEXT,
REQUIRED :parent_image_id AS TEXT OR NULL
):
INSERT OR REPLACE INTO image_metadata_table(image_id, file_md5_hash, blur_hash, parent_image_id)
VALUES (:image_id, :file_md5_hash, :blur_hash, :parent_image_id);
It seems to be getting generated.
Umm no that does not seems to be the case |
Describe the bug
Below is the log, now sure why is it happening and not sure what to make sense out of it.
Version
drift_dev: ^2.16.0
drift: ^2.16.0
The text was updated successfully, but these errors were encountered: