#mysql :: Daggerverse
1 messages ยท Page 1 of 1 (latest)
It's not very good - it only lets you pass in a DB name .. no username or password ...
Maybe I could do withEnvironmentVariable() on my own calling container .. could I do that?
I can make a new release that include those params - this was originally made for integration testing where username/pass didn't matter
I'm going to do that now - i am sure other folks could use that ability
@worthy crater thank you! please ping me once you've done it, and the correct command to use on the CLI, to install it.
So I can add it into my workshop. I've added a placeholder.
Hey @serene patio this is live now and should work for you with username and password ๐ https://daggerverse.dev/mod/github.com/levlaz/daggerverse/mariadb@cea1668da940b45864116049bd20087855c8c787
ty..
I see "Args" as in constructor args like
.mariaDb(arg1, arg2, arg3)
but then I seen this documented example of doing
mariadb().dbPassword()
Question: dbPassword() doesn't look like a function/method call, but only a module constructor argument ..
which is it ? ๐
Can you give me a full example of how to call this module, by passing in all the args?
is it...
mariadb(version, 'db_name', 'db_user', 'db_pass')
@worthy crater
I think this is a bit of a quirk of using an interface.
cc @low trench I think this causes a ton of confusion when we split out the interface args into functions like this
Ill show you an example, which SDK would you be consuming this in?
@worthy crater PHP SDK, which isn't merged but I can give you the dagger init URL to use, if you really wanna test it out on PHP
dagger init --sdk=github.com/dragoonis/dagger/sdk/php@add-php-runtime .
If you go to any existing directory, and run that, then you'll get your files dropped into ./dagger/src/SomeModuleFile.php
Here's a full example in python
import dagger
from dagger import dag, function, object_type
@object_type
class DbDebug:
@function
def debug(self) -> dagger.Container:
"""Returns a container that echoes whatever string argument is provided"""
db = dag.mariadb(version="latest", db_name="foo", db_user="bar", db_password="baz").serve()
return (
dag.container()
.from_("mariadb:latest")
.with_service_binding("db", db)
)
Then you could call this function like this:
dagger call debug terminal
and then inside of that terminal I can connect to the DB like this
mariab -h db -u bar -p foo --skip-ssl
that'll prompt for a password baz and then you're in business
db = dag.mariadb(version="latest", db_name="foo", db_user="bar", db_password="baz").serve()
This, is cool! ๐
FYI the reason Im doing it this way is that serve() base() and debug() all take the same optinal arguments, so the module is a lot cleaner using the interface this way. But the daggerverse page becomes a lot more confusing IMO ๐ฆ
So feels like we need another iteration on how to make daggerverse page make more sense when using an interface
makes sense