KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
alpheratz-database
★ 13
Open GitHub ↗
No description available.
Download README (.md)
Explore Similar Repositories
Flutter-Rounded-Design
:
Flutter Design and Development series
reaction-diffusion
:
Reference implementation and experiments for combining reaction-diffusion and tissue growth
python-webinar
:
Webinar slides and notebook
env-sanitize
:
Sanitization and verification of environment variables with typescript support.
nginx-proxy
:
Example using docker-compose with nginx-proxy and acme companion.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
alpheratz-database
?
Download (.md)
# AlpheratzDatabase - An experimental project of database # HOW TO USE? EXAMPLES. ### CONNECT TO DATABASE ```java DatabaseDriver.INSTANCE.connect(new DatabaseClient(new DatabaseData("127.0.0.1", 2139, new DatabaseUser("root", "none"))), new ConnectCallback() { @Override public void success(DatabaseClient databaseClient) { System.out.println("Connected!"); } @Override public void error(Throwable cause) { System.err.println("Exception thrown!"); } }); ``` ### INSERT DOCUMENT ```java final Collection collection = database.getCollection("test"); collection.insert(Document.parse("{\"nickname\":\"abc123\"}")); ``` ### UPDATE DOCUMENT ```java final Collection collection = database.getCollection("test"); collection.update(new KeyData("nickname", "abc123"), Document.parse("{\"nickname\":\"cba321\"}")); ``` ### READ ALL DOCUMENTS ```java final long startTime = System.currentTimeMillis(); collection.findAsync().setFutureListener((documents) -> { DatabaseDriver.INSTANCE.getLogger().info("Found " + documents.size() + " documents in " + (System.currentTimeMillis() - startTime) + " ms."); }); ``` ### READ DOCUMENT ```java collection.findAsync(new KeyData("nickname", "cba321")).setFutureListener((document) -> { System.out.println("found: " + (Objects.nonNull(document) ? document.toString() : "null")); }); ```