Sign in to follow this  
Followers 0
mouseboyx

Sapp mysql client

DLL that can be loaded and used to perform mysql queries from a sapp lua script

https://github.com/mouseboyx/sapp_mysql_client

 

I had fun learning from ChatGPT to try to make this work.  I learned a little bit about thread safety and how to use a C++ mutex to lock a function.  And how to return a pointer to an instance of a C++ class to lua's strictly C ffi implementation by casting it as a void pointer.  The C++ sources for this dll are a great resource to learn from to implement other functionality like this in the future.

Share this post


Link to post
Share on other sites

Tiddy-bits:

3 hours ago, mouseboyx said:

I learned a little bit about thread safety and how to use a C++ mutex to lock a function.

Not sure if you already know about them or if it'll even be helpful to you in this case, but if mutexes and threads really tickled your pickle you should also look at semaphores. C++ provides libraries for 2 types. Unlike mutexes, semaphores are not tied to the thread of execution.

mouseboyx likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.