From 7a2962b007d1fbf1aa1e4909155679860327b450 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 8 Nov 2023 14:06:15 +0100 Subject: [PATCH] Tests failing on janet 1.32.1-df2d5cb3 * fix import for fixing tests * tiny update in readme --- README.md | 8 ++++---- test/db/pg/db-test.janet | 4 ++-- test/db/sqlite/db-test.janet | 4 ++-- test/db/sqlite/sql-test.janet | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5c683da..56610d5 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ db supports two databases Run this command to create a sqlite database in the current directory ```sh -db create database:sqlite todos_dev.sqlite3 +db new database:sqlite todos_dev.sqlite3 ``` `todos_dev.sqlite3` can be any name @@ -56,7 +56,7 @@ db create database:sqlite todos_dev.sqlite3 Run this command to create a postgres database, assuming a running postgres server and a `createdb` cli script in the current `PATH` ```sh -db create database:postgres todos_dev +db new database:postgres todos_dev ``` ## Migrations @@ -66,7 +66,7 @@ Creating migrations happens with the same cli program which should get installed Note: Make sure you have the janet module `bin` folder in your `PATH`. ```sh -db create migration 'create-table-todos' +db new migration 'create-table-todos' ``` This should create a new folder in your current directory named `db/migrations` and in that folder, there should be an empty `.sql` file named `-create-table-todos.sql`: @@ -79,7 +79,7 @@ This should create a new folder in your current directory named `db/migrations` We can do a little better than that though: ```sh -db create table 'todos' 'name text not null' 'completed-at datetime' +db new table 'todos' 'name text not null' 'completed-at datetime' ``` This should create a new sql file that looks like this: diff --git a/test/db/pg/db-test.janet b/test/db/pg/db-test.janet index bb9c3a9..354dbde 100644 --- a/test/db/pg/db-test.janet +++ b/test/db/pg/db-test.janet @@ -1,8 +1,8 @@ (import tester :prefix "" :exit true) (if (string/has-prefix? "postgres" (or (os/getenv "DATABASE_URL") "")) - (import "src/db/pg/db" :as db) - (import "src/db/sqlite/db" :as db)) + (import /src/db/pg/db :as db) + (import /src/db/sqlite/db :as db)) (when (string/has-prefix? "postgres" (or (os/getenv "DATABASE_URL") "")) diff --git a/test/db/sqlite/db-test.janet b/test/db/sqlite/db-test.janet index 9437c1e..0e5187a 100644 --- a/test/db/sqlite/db-test.janet +++ b/test/db/sqlite/db-test.janet @@ -1,6 +1,6 @@ (import tester :prefix "" :exit true) -(import "src/db/sqlite/db" :as db) -(import "src/db/helper" :prefix "") +(import /src/db/sqlite/db :as db) +(import /src/db/helper :prefix "") (db/connect "test.sqlite3") diff --git a/test/db/sqlite/sql-test.janet b/test/db/sqlite/sql-test.janet index f77ba87..713a6d3 100644 --- a/test/db/sqlite/sql-test.janet +++ b/test/db/sqlite/sql-test.janet @@ -1,5 +1,5 @@ (import tester :prefix "" :exit true) -(import "src/db/sqlite/sql" :as sql) +(import /src/db/sqlite/sql :as sql) (deftest (test "from"