{"id":13743775,"url":"https://github.com/msakrejda/pegasus","last_synced_at":"2025-04-03T05:44:58.640Z","repository":{"id":137869729,"uuid":"388101","full_name":"msakrejda/pegasus","owner":"msakrejda","description":"An ActionScript 3 driver for PostgreSQL.","archived":false,"fork":false,"pushed_at":"2012-03-08T20:50:46.000Z","size":1387,"stargazers_count":16,"open_issues_count":13,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T19:44:21.934Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msakrejda.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2009-11-28T05:06:37.000Z","updated_at":"2023-07-25T13:41:38.000Z","dependencies_parsed_at":"2023-03-13T10:55:43.856Z","dependency_job_id":null,"html_url":"https://github.com/msakrejda/pegasus","commit_stats":null,"previous_names":["uhoh-itsmaciek/pegasus"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msakrejda%2Fpegasus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msakrejda%2Fpegasus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msakrejda%2Fpegasus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msakrejda%2Fpegasus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msakrejda","download_url":"https://codeload.github.com/msakrejda/pegasus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246944385,"owners_count":20858773,"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":[],"created_at":"2024-08-03T05:00:56.936Z","updated_at":"2025-04-03T05:44:58.620Z","avatar_url":"https://github.com/msakrejda.png","language":"ActionScript","funding_links":[],"categories":["Networking"],"sub_categories":["Database"],"readme":"Pegasus\n^^^^^^^\n\nAn ActionScript 3 driver for the PostgreSQL open source database.\n\n\nOverview\n~~~~~~~~\n\nPegasus currently supports both the simple and extended query\nprotocols, clear-text, md5 hashed, and trust authentication, and the\nPostgreSQL notification mechanism (LISTEN/NOTIFY). It has an\nextensible data type handling system with built-in support for the\nmost common types (Date, Number, int, Boolean, and String in\nActionScript, and their PostgreSQL equivalents).\n\nThe pegasus core library can be used in plain Flash stand-alone\napplications, Flash web applications, and Flex or AIR applications\n(albeit the Flash cross-domain policies will prevent you from doing\nanything too colorful from a web app).\n\nThe pegasus repository includes pgconsole, a simple AIR application\nwhich can connect to a PostgreSQL server, issue queries, and display\nresults. It also supports notifications (i.e., you can issue a LISTEN\nand get notifications of the corresponding NOTIFY events).\n\n\nExample\n~~~~~~~\n\nHere is an example of pegasus usage:: \n\n    // Create a ConnectionFactory\n    var connFactory:ConnectionFactory = new ConnectionFactory();\n\n    // Pegasus uses jdbc-like URLs for configuring host, port, and target database\n    // as well as for connection properties (not shown)\n    var url:String = 'asdbc:postgresql://localhost:5432/postgres';\n    var user:String = 'postgres';\n    var password:String = 'postgres';\n    var conn:IConnection = connFactory.createConnection(url, user, password);\n\n    // Add event listeners. The actual functions are omitted; they are fairly\n    // straightforward event handlers. Note that the NoticEvent.ERROR handler\n    // is the mechanism for communicating query errors, so be sure to listen\n    // for at least these events\n    conn.addEventListener(NoticeEvent.NOTICE, handleNotice);\n    conn.addEventListener(NoticeEvent.ERROR, handleError);\n    conn.addEventListener(ParameterChangeEvent.PARAMETER_CHANGE, handleParamChange);\n    conn.addEventListener(NotificationEvent.NOTIFICATION, handleNotification);\n    conn.addEventListener(ConnectionEvent.CONNECTED, handleConnected);\n    conn.addEventListener(ConnectionErrorEvent.CONNECTIVITY_ERROR, handleConnectivityError);\n    conn.addEventListener(ConnectionErrorEvent.PROTOCOL_ERROR, handleProtocolError);\n    conn.addEventListener(ConnectionErrorEvent.CODEC_ERROR, handleCodecError);\n\n    // Each query needs a result handler. Pegasus comes with two types of result handlers,\n    // or you can write your own. A result handler needs to respond to results from\n    // the query (if any) and to successful query completion. The EventResultHandler dispatches\n    // events when results are available and when the query completes.\n    var handler:IResultHandler = new EventResultHandler();\n    // Add a handler for query results; you can often ignore completion\n    IEventDispatcher(handler).addEventListener(QueryResultEvent.RESULT, handleResult);\n    // Parameter markers use standard PostgreSQL syntax. Parameter input\n    // mappings (from ActionScript data types to PostgreSQL types) are\n    // configurable, but defaults are sensible for simple use cases.\n    conn.execute(handler, \"select 'hello ' || $1\", [ 'world' ]);\n\nThis is a sample result handler::\n\n    function handleResult(event:QueryResultEvent):void {\n    \ttrace(\"Columns are:\");\n        for (var col:IColumn in event.columns) {\n\t    trace('Column', col.name, col.type);\n\t}\n\ttrace(\"Data is:\");\n\t// PostgreSQL data types are automatically mapped to corresponding\n\t// ActionScript data types (the mappings can be reconfigured, but\n\t// again, the defaults are sensible for simple uses)\n\tfor (var row:Object in event.data) {\n\t    for (var col:IColumn in event.columns) {\n\t    \ttrace(\"Value for column\", col.name, \"is\", row[col.name]);\n\t    }\n\t}\n    }\n\nA more extensive example is available in `pgconsole`. Asdoc API\ndocumentation is also available.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsakrejda%2Fpegasus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsakrejda%2Fpegasus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsakrejda%2Fpegasus/lists"}