Giter VIP home page Giter VIP logo

helidon-mysql-docstore's Introduction

Helidon Demo with MySQL Document Store

A demo for using Helidon to access a MySQL Document Store

Helidon variation of https://github.com/boyzoid/micronaut-document-store-demo

Setup

This setup assumes you already have access to a MySQL database. *

  • Open MySQL Shell and connect to your MySQL instance using the following command: \c {user}:{password}@{host}:33060

    • Where {user} is the username, {password} is the password, and {host} is the server domain name or IP address of your MySQL instance.
  • In MySQL Shell, run the command session.createSchema('mn_demo') to create the new schema.

  • In MySQL Shell, run the following command: util.importJson( '/absolute/path/to/project/data/scores.json', {schema: 'mn_demo', collection: 'pokemon'})

    • If the process runs successfully, you will see output similar to this: .. 6.. 6 Processed 218 bytes in 6 documents in 0.0076 sec (6.00 documents/s)

Run

Build:

mvn clean package

Run:

java -jar target/doc.jar

Test:

curl -X GET http://localhost:8080/pokemons

or with limit:

curl -X GET http://localhost:8080/pokemons/3

Try to add a Pokemon:

curl -X POST -H "Content-Type: application/json" -d '{"name" : "Poki", "type" : "3"}' http://localhost:8080/pokemons
1

See if the new Pokemon is present:

or with limit:

curl -X GET http://localhost:8080/pokemons/10

Try to update:

 curl -X PUT http://localhost:8080/pokemons/{id}/Pok
 1

Delete a pokemon:

curl -X DELETE http://localhost:8080/pokemons/{id}                

Test with get all Pokemons.

helidon-mysql-docstore's People

Contributors

dalexandrov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.