I am trying to follow the diesel getting started guide - https://diesel.rs/guides/getting-started
The only difference is that I am using sqlite and a file in my local directory. The DATABASE_URL value is set correctly in the env file.
DATABASE_URL=/Users/username/Sandbox/diesel_demo/diesel_demo.db
The file diesel_demo.db also exists.
When running write_post.rs I get the error:
thread 'main' panicked at 'Error connecting to /Users/username/Sandbox/diesel_demo/diesel_demo.db', src/lib.rs:15:63
Related
I am having issue connecting my dbt cloud and dbt core to databricks
I have read these 4 links, but still can not connect
https://docs.databricks.com/integrations/prep/dbt-cloud.html#connect-to-dbt-cloud&language-Cluster
https://docs.databricks.com/integrations/prep/dbt.html
https://docs.getdbt.com/reference/warehouse-profiles/databricks-profile
https://github.com/databricks/dbt-databricks
on dbt-cloud:
When I test the connection during the project creation step, it passed the test. however when I use the connection to create a job and run, it returns this message:"Cannot set database in spark!"
Edit: the issue once has been fixed but it comes back again.
original fix:
The dbt-core connection issue has been fixed. The issue is caused by the python certificate issue on MacOS. please refer to this link for the solution
on dbt-core:
this how I set up my profiles.yaml file base on the documentations:
databrick_dbt_lakehouse:
outputs:
dev:
host: adb-755xxxxxxx7.7.azuredatabricks.net
http_path: /sql/protocolv1/o/755xxxx7/0517-xxxxxx-xxxxxx
schema: default
threads: 1
token: dapi<my token>
type: databricks
target: dev
Note:
for http_path i have tried both with or without backslash (/) before sql/...
I assume the schema means database name. I have tried 2, but none of them works
I use pipenv with python version 3.8.8
when I run dbt debug I got this message:
check failed:
dbt was unable to connect to the specified database.
The database returned the following error:
Runtime Error
Database Error
failed to connect
Please help, thanks
Your http_path seems wrong. Here is an extract from my profiles.yml
databricks_dbt_demo:
outputs:
dev:
host: adb-redacted.azuredatabricks.net
http_path: /sql/1.0/endpoints/redacted # for SQL Endpoint
# http_path: /sql/protocolv1/o/{ORG-ID}/{CLUSTER-ID} # for All-Purpose Cluster
schema: your_database_here
token: your_personal_access_token_here
type: databricks
target: dev
Are you using a cluster (e.g. All Purpose Cluster) or a SQL Endpoint?
Edit: This issue is came back again. I am writing this comment on the 3rd day after the original fix
When I run dbt run or dbt snapshot the returns this error message:
Encountered an error:
Runtime Error
Database Error
failed to connect
original fix:
The issue is caused by the python certificate issue on MacOS. please refer to this link for the solution.
The dbt cloud issue is caused by the incorrect schema name in the yaml file
I have installed Oracle in my system and wanted to change my local database to Oracle, but making changes in the database-config.xml I am unable to get my server started and getting the following error:
java.lang.RuntimeException : No Appropriate database found in
configuration: env = 'local'
Just add to your configuration file (database-config.xml) the parameter env="local".
Example:
<database
autoupgrade="full"
name="BillingCenterDatabase"
dbtype="oracle"
env="local">
I am getting started with Diesel by following their official documentation. I also have PostgreSQL installed. My database username is postgres and the password is 1schoollife#.
I started with
$ echo DATABASE_URL=postgres://postgres:1schoollife##localhost/diesel_demo > .env
$ diesel setup
results:
Creating migrations directory at: /home/naufil/Desktop/rust/3june/testing/migrations
Creating database: diesel_demo
database "diesel_demo" already exists
I created a migration:
$ diesel migration generate create_posts
Creating migrations/2019-06-03-182531_create_posts/up.sql
Creating migrations/2019-06-03-182531_create_posts/down.sql
I get the following error when migrating the database:
$ diesel migration run
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ConnectionError(BadConnection("could not translate host name \"#localhost\" to address: Name or service not known\n"))', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
The DATABASE_URL you have provided is not the URL you are attempting to use. # is a special character that separates the credentials from the hostname. Since your credentials contain an #, it needs to be URL escaped:
postgres://postgres:1schoollife%40#localhost/diesel_demo
Diesel maintainer sgrif said:
Yes, percent encoding is 100% the correct thing for us to be doing.
This was implemented in PR 1058
I keep getting this error:
Error trying to parse settings: Expected character in Packages\User\SublimeLinter.sublime-settings:69:2
I am attaching the screenshots, also I am running version 3.1.1 build 3176.
I added/made changes here
"error_color": "D02000"
Here is my code for user settings:
Error
I have run an SQL script under Linux using #xxx.sql but I get the following error :
Warning: Function created with compilation errors.
The database is in Oracle.
I have used the command SHOW ERROR to get more details and I was wondering if the errors shown are stored in some log file
somewhere? Any idea?