Skip to content
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

Adding DB support to the whole app #7

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mickeydarrenlau
Copy link

Adding db support and the appropriate schema and the api endpoint.
Currently read only.

@safeboot
Copy link
Owner

safeboot commented Mar 8, 2024

LGTM!

I'll review it and tweak it if necessary.

@safeboot
Copy link
Owner

safeboot commented Mar 8, 2024

A few comments here, can you explain why you re-added the example-config.json file? We've moved to SQLite so I don't think we have a use for JSON files.

Also I see you installed compression and sirv but haven't used them, is there something you're planning to do with them or are they leftovers?

The other changes look good to me, again I have to test them but I am currently travelling.

-safeboot

@mickeydarrenlau
Copy link
Author

Oh no
Just forgot to remove them

Also the two lib is the code from yours

@mickeydarrenlau
Copy link
Author

mickeydarrenlau commented Mar 8, 2024

I can still help you with the code but might need a little more effort to do.

I moved to turso and it's the exact same code except the way the query works

So mine is

app.use('/api/settings', async (req, res) => {
  const stmt = await db.execute('SELECT * FROM settings');
  let data = []
  for(let each of stmt["rows"]) {
    data.push({"name":  each[0], "value": each[1]})
  }
  res.json(data);
});

Don't worry
I will still be able to contribute but due to needing to rewrite every piece of the api handler before push might be a bit of work but ok.

And you can actually read the files via the turso lib because they support local files

https://docs.turso.tech/sdk/ts/quickstart

So we might even be able to add support for both file and libsql dbs

@mickeydarrenlau
Copy link
Author

mickeydarrenlau commented Mar 9, 2024

Also another update
Motion won't work with SSR
vueuse/motion#58

Fixed on my side with AOS

@safeboot safeboot added the enhancement New feature or request label Mar 21, 2024
@mickeydarrenlau
Copy link
Author

Do I push my changes

cause I have fixes for the animation and turso lib support all local sqlite and libsql servers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants