-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat]: add gatsby-source-sql #8714
Comments
me me me! Could you also direct on where to start? :) |
@daubaris 👋 Absolutely! So I'd recommend checking out one of the source plugins I linked, and kinda re-tracing from there! So high level, this is what this will look like:
If you're interested, we'd love to help out with a pairing session, as well. Sign up for those here And let me know if I can help with this further :) |
If I were to suggest sqlite support as well, would that be lumped into this plugin or it's own thing? |
@garetmckinley good question! I'm not sure how to best resolve that complexity to be honest with you. Ideally there'd be one shared sql plugin, but the more I think about it, I'm not sure how tenable that is because the engine will have to change between MySQL, mssql, SQLLite, etc. So we may be able to introduce some shared helpers, but I think this plugin may take additional plugins, and those plugins should implement some API perhaps? |
(very similar to gatsby-transformer-remark if you're familiar!) |
Yeah, I think that makes the most sense! I'll keep an eye on the progress of this issue, because I have a use-case for gatsby with sqlite. I'd be more than happy to work on a sqlite plugin for this source when the time comes. |
@garetmckinley that would be so great! Stay tuned 👀 |
Once this progresses i d like to look for some postgres integration as well. |
Is this claimed? |
Is this open? If so I would like to work on it if someone's not doing it already. |
@mrfunnyshoes do it if not even for the learning experience. |
@mrfunnyshoes yep! Feel free to tackle this, we'd love to see this! |
Thanks! Do you guys think using knex be overkill for this task? |
@mrfunnyshoes. Whoa, I’ve never heard of that! That seems like a nice, flexible option! All for it! |
I just implemented something similar, but for mysql only. It is just a thin wrapper around the library |
@malcolm-kee great! I think there's still some value in what @mrfunnyshoes proposed, so perhaps we can work on integrating Looks great, though - happy to see more plugins relating to this! Nice work! |
@DSchau agree! That is much useful than only support mysql. Just share as another reference 😁 |
Hey guys! I've got a working version here. Let me know what you think. I'm actually new to contributing to a FOSS project. PS: I think It would be nice to nest the resulting data inside the |
@mrfunnyshoes my suggestions:
Other than that, great works! |
Thanks @malcolm-kee, will look into your suggestions! |
@mrfunnyshoes this is incredible. Would you consider it production ready? If so, could you publish this to NPM? This will submit it to the plugin library as well! cc @DSchau |
There’s is already this PR |
@malcolm-kee we'd love to have this plugin in the official Gatsby repository. I haven't taken a super close look at the code, but the functionality you're able to build in (in a database agnostic way) looks perfect. Perhaps we schedule some time next week, and I can walk you through how we'd get this PR'd up to the official Gatsby monorepo? Feel free to use my Calendly and we can get this up and running. Again--thank you! This looks great! |
@DSchau are you intends to message @mrfunnyshoes for |
Hey guys @DSchau, @malcolm-kee! Yes, I think we could start working on the PR. Should I publish this to npm already, or will that be part of adding it to the monorepo? |
@mrfunnyshoes Hi! So is your plugin ready to go for a PR against Gatsby's repo? If so we should close this PR #8875 and you can open up yours. Please let us know if you need help with the PR. I don't think you need to publish to npm as the monorepo will handle this once your PR is merged 👍 |
Thanks @LekoArts! I think the plugin is ready for PR, I'm not completely sure how to proceed with it though. I'll start by following these instructions and come here with any doubts. |
If you have problems you can also join our Discord (https://discord.gg/jUFVxtB) and ask there 👍 (Or open the PR and we'll talk in the PR) |
Thanks @LekoArts, I submitted a PR |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m Thanks again for being part of the Gatsby community! |
Reopening as there is a related PR open for this. |
Closing this since #11100 (comment) Keep an eye out for @mrfunnyshoes's fantastic plugin that will enable this! |
FYI: https://github.com/edgarrmondragon/gatsby-source-sql |
Summary
It'd be awesome to be able to (at build time!) inject content from a SQL database, just like we do for other source types, e.g. filesystem, Contentful, etc.
Motivation
Further Detail
The general idea is that the source plugin will need to be able to connect to a SQL database (MySQL, MSSQL, ... ?; happy to start small and grow it in the future!) and query that data to inject into the GraphQL content layer for further processing via Gatsby.
Consider mysql, mssql for various means to inject data
See other source plugins for more info on how to build this out, e.g. gatsby-source-contentful, gatsby-source-wordpress, etc.
The text was updated successfully, but these errors were encountered: