Is there a reason I am getting this Backpack DevTools error? - laravel-backpack

I am getting the following error after running the backpack devtools install.
php artisan backpack:devtools:install
I'm unsure about the warning above. My env is set to local.
Now the DevTools menu item appears and when I click it I get the following exception:
Illuminate\Database\QueryException
could not find driver (SQL: create table "models" ("file" varchar, "id" integer not null primary key autoincrement, "file_type" varchar, "file_extension" varchar, "file_path" varchar, "file_path_absolute" varchar, "file_path_relative" varchar, "file_path_from_base" varchar, "file_name" varchar, "file_name_without_extension" varchar, "file_name_with_extension" varchar, "file_last_accessed_at" datetime, "file_last_changed_at" datetime, "file_last_modified_at" datetime, "file_created_at" datetime, "file_directory" varchar, "file_contents" varchar, "class_name" varchar, "class_namespace" varchar, "class_path" varchar, "class_path_with_extension" varchar, "created_at" datetime, "updated_at" datetime))

Most likely you do not have SQLite installed - or the sqlite extension is not enabled in your php.ini
Backpack uses Laravel Sushi, which itself uses SQLite to store all the information about Models etc.

Related

Creating my first table- Syntax error at or near ();

First day of postgreSQL- sorry if this is too basic, but couldn't find the answer on here.
So basically I'm following a video tutorial, and have written exactly the same lines as tutorial, yet I get above mentioned syntax error when trying to clear:
CREATE TABLE Actors(
actor_id SERIAL PRIMARY KEY,
first_name VARCHAR(30),
last_name VARCHAR(30)NOT NULL,
gender CHAR(1),
date_of_birth DATE,
);
I know there is probably a super simple solution but I cant seem to find out what after nearly 2 hours- help
No need to apologize!
For clean queries, always recommended to put a [SPACE] after datatypes (for example: VARCHAR(30)[SPACE]NOT NULL ) and always be sure to remove your COMMAS right before your closing parenthesis.
CREATE TABLE Actors(
actor_id SERIAL PRIMARY KEY,
first_name VARCHAR(30),
last_name VARCHAR(30) NOT NULL,
gender CHAR(1),
date_of_birth DATE
)
Remove the , after date_of_birth and perhaps add a space before NOT NULL
CREATE TABLE Actors (
actor_id SERIAL PRIMARY KEY,
first_name VARCHAR(30),
last_name VARCHAR(30) NOT NULL,
gender CHAR(1),
date_of_birth DATE
);

why won't my SQL run in vscode? What can I do to fix this?

I am following this tutorial for SQL: https://www.youtube.com/watch?v=Cz3WcZLRaWc
I followed all the instructions, but when I click run I get a message saying Code language not supported or defined. How do I fix this?
--#block
CREATE TABLE User(
id INTEGER PRIMARY KEY,
email VARCHAR(255) NOT NULL UNIQUE,
bio TEXT,
country VARCHAR(2),
);

Segment by in TimescaleDB requires foreign key id to be used for segmenting

I am working with the following use case:
A large number of users that each have their own separate time series. Each measurement in the time series has been made with a device, that has some accompanying metadata.
To create a TimescaleDB hypertable for this, I did the following:
CREATE TABLE devices (
id VARCHAR NOT NULL,
brand VARCHAR,
model VARCHAR,
serial_number VARCHAR,
mac VARCHAR,
firmware VARCHAR,
UNIQUE (id),
PRIMARY KEY (id)
);
CREATE TABLE measurements (
time TIMESTAMPTZ NOT NULL,
measurement_location VARCHAR,
measurement_value DOUBLE PRECISION NOT NULL,
device_id, VARCHAR NOT NULL,
customer_id VARCHAR NOT NULL,
FOREIGN KEY (device_id) REFERENCES devices (id)
);
SELECT create_hypertable('measurements', 'time');
ALTER TABLE measurements SET (
timescaledb.compress,
timescaledb.compress_segmentby='customer_id'
);
I wanted to segment by the customer id - since all measurements for a user is what generally will be queried.
However, when I do this I get the following error:
ERROR: column "device_id" must be used for segmenting
DETAIL: The foreign key constraint "measurements_device_id_fkey" cannot be enforced with the given compression configuration.
Why is it that I must use the foreign key for my segmentation? Is there another better way to accomplish what I want to do here?
Timescale engineer here. One of the limitations with compression is that we cannot cascade deletes from foreign tables to compressed hypertables, unless it is a non compressed column. Segment by columns are stored in non compressed form. That's the reason behind the restriction on foreign key constraints.

How to handle duplicate column names while defining schema in KSQL

How to handle duplicate column names while defining schema. In the below code trying to create duplicate columns for SOURCES and alias with SOURCES_ARRAY. Getting errors as we cannot alias columns name. Any help would be appreciated.
create stream example
(with topic='example_topic',value_format='JSON')
(changeType varchar,
domain varchar,
id varchar,
payload struct<id varchar,
domain varchar,
rootState varchar,
sources array<struct<
source varchar,
domain varchar, ETC >>>,
payload struct<sources array<varchar) as sources_array;

How to remove auto increment of table column in sqlite?

i had create my table using below code:
create table tbl_questionnair(qid integer primary key autoincrement, title varchar, uid integer, superadminid integer,TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
Now i want to remove auto increment of qid. Anyone can help me?
sqLite doesnot support alter table so drop the older table and create it once again
Simply remove the qid as primary key.
create table tbl_questionnair(qid integer, title varchar, uid integer, superadminid integer,TIMESTAMP DEFAULT CURRENT_TIMESTAMP);