-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d72ffcc
commit 782d05f
Showing
7 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,3 +87,4 @@ clog/ | |
manifest/ | ||
.mypy_cache/ | ||
.ruff_cache/ | ||
tests/db_snapshots/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
# navigate to directory | ||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
cd $SCRIPTPATH | ||
|
||
cd .. | ||
cd tests | ||
|
||
if [ -d "./db_snapshots" ]; then | ||
echo "DB snapshots are already present" | ||
rm -rf ./db_snapshots | ||
fi | ||
|
||
dockpack pull -i maxwellflitton/surrealdb-data -d ./db_snapshots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from typing import List | ||
from unittest import TestCase, main | ||
|
||
from surrealdb import SurrealDB, RecordID | ||
from tests.integration.connection_params import TestConnectionParams | ||
import asyncio | ||
import websockets | ||
|
||
|
||
class TestBatch(TestCase): | ||
|
||
def setUp(self) -> None: | ||
self.params = TestConnectionParams() | ||
self.db = SurrealDB(self.params.url) | ||
self.queries: List[str] = [] | ||
|
||
self.db.connect() | ||
self.db.use(self.params.namespace, self.params.database) | ||
self.db.sign_in("root", "root") | ||
|
||
# self.query = """ | ||
# CREATE |product:1000000| CONTENT { | ||
# name: rand::enum('Cruiser Hoodie', 'Surreal T-Shirt'), | ||
# colours: [rand::string(10), rand::string(10),], | ||
# price: rand::int(20, 60), | ||
# time: { | ||
# created_at: rand::time(1611847404, 1706455404), | ||
# updated_at: rand::time(1651155804, 1716906204) | ||
# } | ||
# }; | ||
# """ | ||
# self.db.query(query=self.query) | ||
|
||
def tearDown(self) -> None: | ||
pass | ||
|
||
def test_batch(self): | ||
print("test_batch") | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters