{"id":16087198,"url":"https://github.com/juliendelplanque/dbconnectionsmanager","last_synced_at":"2025-04-05T15:11:03.946Z","repository":{"id":83914444,"uuid":"114253997","full_name":"juliendelplanque/DBConnectionsManager","owner":"juliendelplanque","description":"A tool to manage connections to DBMS and their states from Pharo.","archived":false,"fork":false,"pushed_at":"2019-09-06T09:56:59.000Z","size":774,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-11T11:51:43.376Z","etag":null,"topics":["pharo","smalltalk"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juliendelplanque.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-14T13:28:41.000Z","updated_at":"2019-09-06T09:57:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e68c576-3731-4609-a30f-6ab9247f91c3","html_url":"https://github.com/juliendelplanque/DBConnectionsManager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FDBConnectionsManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FDBConnectionsManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FDBConnectionsManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FDBConnectionsManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliendelplanque","download_url":"https://codeload.github.com/juliendelplanque/DBConnectionsManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353749,"owners_count":20925329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pharo","smalltalk"],"created_at":"2024-10-09T13:28:43.336Z","updated_at":"2025-04-05T15:11:03.920Z","avatar_url":"https://github.com/juliendelplanque.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DBConnectionsManager\nA tool to manage connections to DBMS and their states from Pharo.\n\n## Install\n```\nMetacello new\n    baseline: 'DBConnectionsManager';\n    repository: 'github://juliendelplanque/DBConnectionsManager/repository';\n    load\n```\n\n## How to use\n\n### Open the UI\nThe `DBConnectionsManager` comes with a simple UI allowing to check the state\nof connections, to add/remove connection descriptions and to connect/disconnect\nthem. To open this UI, either use the world menu or run this script:\n```\nDBConnectionsManagerWidget openOnCurrent\n```\n\nWhich leads to the following widget open:\n![Connections manager empty](https://raw.githubusercontent.com/juliendelplanque/DBConnectionsManager/master/screenshots/DBConnectionsManager.png)\n\nFirst, turn on the connections checker by clicking on the dedicated. This will\nstart a thread that regularly checks the state of the connections added to\n`DBConnectionsManager current`.\n\nThen, you need to create a new connection description. To do so, click on the\n'New connection' button. You get a widget with a form to fill.\n\n![Connections manager new connection](https://raw.githubusercontent.com/juliendelplanque/DBConnectionsManager/master/screenshots/ConnectionDescription.png)\n\nOnce you filled the form with the correct information about your connection,\nyou can test your connection using the dedicated button.\n\n![Connection test](https://raw.githubusercontent.com/juliendelplanque/DBConnectionsManager/master/screenshots/ConnectionDescription2.png)\n\nIf you get a popup saying that 'Connection works perfectly.', your configuration is\ngood and you can click 'Ok' to create the connection description and to add it to\nthe connections manager.\n\nOnce it is done, you can right-click on the connection description appearing in the\nlist. A menu appears allowing you to connect the connection description.\n\n![Connection connect](https://raw.githubusercontent.com/juliendelplanque/DBConnectionsManager/master/screenshots/DBConnectionsManager1.png)\n\nOnce you connected the connection description, the icon turns yellow meaning that it\nhasn't been checked by the connections checker yet.\n\n![Connection not checked](https://raw.githubusercontent.com/juliendelplanque/DBConnectionsManager/master/screenshots/DBConnectionsManager2.png)\n\nOnce the connection checker tested the connection description, the icon turns green.\nTil the icon stays green, you know your connection to the database works perfectly.\n\n![Connection green](https://raw.githubusercontent.com/juliendelplanque/DBConnectionsManager/master/screenshots/DBConnectionsManager3.png)\n\nIf a problem appears on your connection (e.g. the DBMS stops working, the server\nis not reachable anymore, etc...), the icon will turn red.\n\n![Connection red](https://raw.githubusercontent.com/juliendelplanque/DBConnectionsManager/master/screenshots/DBConnectionsManager4.png)\n\nIf you right click on the connection list, you get a list of actions. The first\nset of actions concern the connection selected and will only appear if a connection\nis selected in the list. The second set concerns actions to apply on all connections\nor actions that do not require a connection to be selected.\n\n![Connection actions](https://raw.githubusercontent.com/juliendelplanque/DBConnectionsManager/master/screenshots/DBConnectionsManager5.png)\n\n### Store your connection descriptions on the disk\nThe `ConnectionsManager` lets you store your connection descriptions on the disk\nfor latter reuse. To save a connection description, left click on one of the\nconnection in the list and select 'Save on disk...' action. It will open a\nfile dialog allowing to select the location of the file that will store the\nconnection description serialized in JSON format.\n\nTo load a connection description previously stored on the disk, left click\non the connections list and select 'Load from disk...' action. This action will\nlet you select a JSON file containing a connection description serialized. Once\nselected, confirm your choice in the file dialog and the connection description\nwill be loaded and added to the list of connection descriptions.\n\n## Integrate the connection descriptions list in your Spec's widgets\nThe `DBConnectionDescriptionsListWidget` can be integrated in other UI widgets\nin order to let the user manipulate connection descriptions easily.\n\nTo instantiate such widget, you simply need to use its `#adaptToConnectionsManager:`\nmessage to adapt it to an instance of `DBConnectionsManager` (listen to announcements,\netc...).\n\nOnce you're done with this widget, use its `#unsubscribeFromSubscribedTo` to\nmake it stop listening to the `DBConnectionsManager` instance provided\npreviously.\n\nAs an example, the [`DBPlayground`](https://github.com/juliendelplanque/DBPlayground)\nuses this widget as a subwidget:\n\n![DBPlayground](https://raw.githubusercontent.com/juliendelplanque/DBConnectionsManager/master/screenshots/DBPlayground.png)\n\n## Listen to announcements\nThe `ConnectionsManager` provide an `#announcer` which can be used to perform\nactions when something happened to a connection.\n\nFor now, the `ConnectionsManager` create the following announcements:\n\n- `DBConnectionDescriptionAdded`: created when a connection description has been added to its list of connections.\n- `DBConnectionDescriptionRemoved`: created when a connection description has been removed from its list of connections.\n- `DBConnectionDied`: created when a connection that was alive died.\n- `DBConnectionRevive`: created when a connection that was dead is alive again.\n- `DBConnectionStillAlive`: created when a connection was alive and continue to be alive.\n- `DBConnectionWasConnectedByUser`: created when a connection connected by the user (so, on purpose).\n- `DBConnectionWasDisconnectedByUser`: created when a connection was disconnected by the user (so, on purpose).\n- `DBConnectionsManagerStartedChecking`: created when it started its thread that check connections.\n- `DBConnectionsManagerStoppedChecking`: created when it stopped its thread that check connections.\n- `DBCurrentConnectionsManagerChanged`: created when the `#current` class-side instance variable of DBConnectionsManager is modified.\n\nFor example to log when a connection dies in the transcript, one can simply\nwrite:\n\n```\nDBConnectionsManager current announcer when: DBConnectionDied do: [ :ann |\n\tTranscript\n\t\tshow: ann connectionDescription name;\n\t\tshow: ' just died :-(.';\n\t\tcr ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendelplanque%2Fdbconnectionsmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliendelplanque%2Fdbconnectionsmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendelplanque%2Fdbconnectionsmanager/lists"}