Git Product home page Git Product logo

Comments (7)

edeandrea avatar edeandrea commented on May 25, 2024

That's what was on the most recent export I got from

https://raw.githubusercontent.com/cescoffier/supes-data/master/heroes-import.sql

https://raw.githubusercontent.com/cescoffier/supes-data/master/villains-import.sql

from quarkus-super-heroes.

cescoffier avatar cescoffier commented on May 25, 2024

Yeah, I would need to regenerate these files too.

from quarkus-super-heroes.

edeandrea avatar edeandrea commented on May 25, 2024

I notice there are some json files as well in that repo you have. Do those json files contain all the same records? It looks like it uses an array of strings and the powers have spaces in them.

If so, I bet I could write a quick script which re-generates the sql files from that.

from quarkus-super-heroes.

edeandrea avatar edeandrea commented on May 25, 2024

Maybe this is also a good opportunity to separate the persistence model from the view model and use Mapstruct in between?

Maybe the persistence model stores the powers as a List<String> and the view model just uses String?

from quarkus-super-heroes.

edeandrea avatar edeandrea commented on May 25, 2024

@cescoffier How's this?

https://raw.githubusercontent.com/quarkusio/quarkus-super-heroes/characterdata/all-heroes.sql

https://raw.githubusercontent.com/quarkusio/quarkus-super-heroes/characterdata/all-villains.sql

I pulled in the json files in your repo into the characterdata branch and then I created a script which generates the SQL files from the json files: https://raw.githubusercontent.com/quarkusio/quarkus-super-heroes/characterdata/generate-sql-from-json.groovy (things like this are VERY trivial in Groovy!)

It can be run like groovy generate-sql-from-json.groovy all-heroes.json all-heroes.sql hero (for Heroes) and groovy generate-sql-from-json.groovy all-villains.json all-villains.sql villain (for Villains).

If this looks good to you I'll move it into the main branch and re-run my script which randomly grabs 100 of each

from quarkus-super-heroes.

cescoffier avatar cescoffier commented on May 25, 2024

Looks great! What about using JBang instead of Groovy? It will make @maxandersen happy.

from quarkus-super-heroes.

edeandrea avatar edeandrea commented on May 25, 2024

Java is so over-complicated when it comes to things like this :) You see how simple it is in Groovy since dealing with structured data is part of the language itself.

from quarkus-super-heroes.

Related Issues (20)

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.