Setting a script dependency of m-a OR oxmysql?

If I were writing a script designed to work with either mysql-async or oxmysql, is there a way to write that dependency in the fxmanifest or do I need to provide multiple fxmanifest files?

As an example, one with:

server_scripts {
  '@mysql-async/lib/MySQL.lua',
  'server/main.lua'
}

dependencies {
    'mysql-async'
}

And the other with:

server_scripts {
	'@oxmysql/lib/MySQL.lua',
	'server/main.lua'
}

dependencies {
    'oxmysql'
}

Just wondering how others handle it.

This seems silly.

Sadly, there’s no ‘or’ stuff at all at this time, but technically you could manually implement dependency stuff in an early-executing script (and add both resources’ @ files). I don’t get why oxmysql doesn’t use provide to be compatible with mysql-async scripts, though… this is exactly why provide was added.


Similarly, and this would be the cleanest method, you could make two ‘adapter’ resources, e.g. schwimsql-oxmysql and schwimsql-mysql-async and have that one provide 'schwimsql' and contain an include file that wraps the respective library’s API.

1 Like

This seems to be the point where I’ve gotten stuck. How do I wrap m-a’s api? Does anyone know of another resource that does that that I could look through?

oxmysql provides mysql-async so you can just use MySQL async as the dependacies

Reference for this

Ah, so it does. I assumed this question was posited as it didn’t. :stuck_out_tongue:

My fault, sorry. I didn’t see that as part of it’s wonders.