<commit_before><?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
    xmlns:debug="org.postgresql.debug.*">
<mx:Script>
    <![CDATA[
        import org.postgresql.codec.decode.TextOut;
        import org.postgresql.event.ResultEvent;
        import org.postgresql.event.ResultEvent;
        import org.postgresql.db.IResult;
        import org.postgresql.db.QueryHandlerFactory;
        import org.postgresql.db.Column;
        import org.postgresql.event.MetadataEvent;
        import org.postgresql.event.ResultSetEvent;
        import org.postgresql.db.IResultSet;
        import org.postgresql.util.DateFormatter;
        import org.postgresql.util.assert;
        import org.postgresql.log.Log;
        import org.postgresql.log.LogLevel;
        import org.postgresql.log.TraceTarget;
        import org.postgresql.io.SocketDataStreamFactory;
        import org.postgresql.febe.MessageBrokerFactory;
        import org.postgresql.Oid;
        import org.postgresql.codec.decode.IntOut;
        import org.postgresql.codec.decode.DateOut;
        import org.postgresql.codec.CodecFactory;
        import mx.controls.Alert;
        import org.postgresql.febe.FEBEConnection;
        import org.postgresql.db.IStatement;
        import org.postgresql.db.Connection;
        import org.postgresql.febe.message.Query;

        import org.postgresql.io.SocketDataStream;
        import org.postgresql.febe.message.StartupMessage;
        import org.postgresql.febe.MessageBroker;
    
        private var str:SocketDataStream;
    
        private function handleClick(e:Event):void {
            trace('connecting');
            if (Capabilities.isDebugger) {
                var logTarget:TraceTarget = new TraceTarget();
                logTarget.format = "%d %t [%l] %c - %m (%n): %s";
                Log.addTarget(logTarget, LogLevel.DEBUG);
            }

            var brokerFactory:MessageBrokerFactory =
                new MessageBrokerFactory(
                    new SocketDataStreamFactory('localhost', 5432));
            var params:Object = {
                user: 'maciek',
                database: 'maciek'
            };
            var codecFactory:CodecFactory = new CodecFactory();
            codecFactory.registerDecoder(Oid.INT2, int, new IntOut());
            codecFactory.registerDecoder(Oid.INT4, int, new IntOut());
            codecFactory.registerDecoder(Oid.TIMESTAMP, Date, new DateOut());
            codecFactory.registerDecoder(Oid.TIMESTAMPTZ, Date, new DateOut());
            codecFactory.registerDecoder(Oid.BPCHAR, String, new TextOut());
            codecFactory.registerDecoder(Oid.VARCHAR, String, new TextOut());
            codecFactory.registerDecoder(Oid.CHAR, String, new TextOut());
            codecFactory.registerDecoder(Oid.TEXT, String, new TextOut());
            var febeConn:FEBEConnection = new FEBEConnection(params, 'foo', brokerFactory);
            var conn:Connection = new Connection(febeConn, new QueryHandlerFactory(codecFactory));
            var stmt:IStatement = conn.createStatement()
            var result:IResultSet = stmt.executeQuery("select now()::timestamp as t1, now()::timestamptz as t2, " +
                "'foo'::char(3) as txt1, 'foo'::varchar(3) as txt2, 'foo'::text as txt3");
            result.addEventListener(MetadataEvent.METADATA, handleMetadata);
            result.addEventListener(ResultSetEvent.RESULT, handleData);
            var result1:IResult = stmt.executeUpdate("drop table if exists test");
            result1.addEventListener(ResultEvent.RESULT, handleResult);<commit_msg>Checking float4 and float8.<commit_after><?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
    xmlns:debug="org.postgresql.debug.*">
<mx:Script>
    <![CDATA[
        import org.postgresql.codec.decode.FloatOut;
        import org.postgresql.codec.decode.TextOut;
        import org.postgresql.event.ResultEvent;
        import org.postgresql.event.ResultEvent;
        import org.postgresql.db.IResult;
        import org.postgresql.db.QueryHandlerFactory;
        import org.postgresql.db.Column;
        import org.postgresql.event.MetadataEvent;
        import org.postgresql.event.ResultSetEvent;
        import org.postgresql.db.IResultSet;
        import org.postgresql.util.DateFormatter;
        import org.postgresql.util.assert;
        import org.postgresql.log.Log;
        import org.postgresql.log.LogLevel;
        import org.postgresql.log.TraceTarget;
        import org.postgresql.io.SocketDataStreamFactory;
        import org.postgresql.febe.MessageBrokerFactory;
        import org.postgresql.Oid;
        import org.postgresql.codec.decode.IntOut;
        import org.postgresql.codec.decode.DateOut;
        import org.postgresql.codec.CodecFactory;
        import mx.controls.Alert;
        import org.postgresql.febe.FEBEConnection;
        import org.postgresql.db.IStatement;
        import org.postgresql.db.Connection;
        import org.postgresql.febe.message.Query;

        import org.postgresql.io.SocketDataStream;
        import org.postgresql.febe.message.StartupMessage;
        import org.postgresql.febe.MessageBroker;
    
        private var str:SocketDataStream;
    
        private function handleClick(e:Event):void {
            trace('connecting');
            if (Capabilities.isDebugger) {
                var logTarget:TraceTarget = new TraceTarget();
                logTarget.format = "%d %t [%l] %c - %m (%n): %s";
                Log.addTarget(logTarget, LogLevel.DEBUG);
            }

            var brokerFactory:MessageBrokerFactory =
                new MessageBrokerFactory(
                    new SocketDataStreamFactory('localhost', 5432));
            var params:Object = {
                user: 'maciek',
                database: 'maciek'
            };
            var codecFactory:CodecFactory = new CodecFactory();
            codecFactory.registerDecoder(Oid.INT2, int, new IntOut());
            codecFactory.registerDecoder(Oid.INT4, int, new IntOut());
            codecFactory.registerDecoder(Oid.FLOAT4, int, new FloatOut());
            codecFactory.registerDecoder(Oid.FLOAT8, int, new FloatOut());
            codecFactory.registerDecoder(Oid.TIMESTAMP, Date, new DateOut());
            codecFactory.registerDecoder(Oid.TIMESTAMPTZ, Date, new DateOut());
            codecFactory.registerDecoder(Oid.BPCHAR, String, new TextOut());
            codecFactory.registerDecoder(Oid.VARCHAR, String, new TextOut());
            codecFactory.registerDecoder(Oid.CHAR, String, new TextOut());
            codecFactory.registerDecoder(Oid.TEXT, String, new TextOut());
            var febeConn:FEBEConnection = new FEBEConnection(params, 'foo', brokerFactory);
            var conn:Connection = new Connection(febeConn, new QueryHandlerFactory(codecFactory));
            var stmt:IStatement = conn.createStatement()
            var result:IResultSet = stmt.executeQuery("select now()::timestamp as t1, now()::timestamptz as t2, " +
                "'foo'::char(3) as txt1, 'foo'::varchar(3) as txt2, 'foo'::text as txt3, 1.2::float4 as float4, 1.3::float8 as float8");
            result.addEventListener(MetadataEvent.METADATA, handleMetadata);
            result.addEventListener(ResultSetEvent.RESULT, handleData);
            var result1:IResult = stmt.executeUpdate("drop table if exists test");
            result1.addEventListener(ResultEvent.RESULT, handleResult);
{'fraction_non_alphanumeric': 0.1082794137065892, 'fraction_numerical': 0.0073946916677670674, 'mean_word_length': 2.6856447688564478, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 2, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1842021', 'n_tokens_mistral': 2191, 'n_tokens_neox': 2140, 'n_words': 384}