?? ?? ??? ????? ??? ?????? ?? ???? ?????. ??? ? ??? ???? ????? ???? ?????(???? ? ????). ??? ???? ?? ???? D ????? ??? ??????. D? ?? ??? C? CPP? ?? ?????.
D? ?????? ?????? '**D?? ?? ???, ??? ?? ??? ? C? ??? ??? ?? ?? ????? ?????. D ????? ??? ???? ??? ??, ??? ??, ??? ??? ? ????.”
?? ??? ??????? PostgreSQL? ?????, ??? ? ??????? PostgreSQL? ??????. PostgreSQL? ?? ???? ???? ?? ?? ???? SQL ?????? ??? ? ???? ? ??? ?? ???? ????.
??? ORM ?????? ???? ??? ??????
D ??? ?? ? ? ?? ??? ???? ??? ??? ?? ? ?????. ???? ?? ??? ????? ?? ????? ??? ? ?????. JavaScript ???? Sequalize ORM? ??????. ??? ????? ????, D??? ??? ????? ?????
??? ? ??? ?? Postgres? C? ?????? ????? ?? ?? ?????. ??? ? D?? C ???? ???? ?? ORM ??? ???? ??? ?? ??? ?????. C ?????? D? ????? ?? ?? ??? https://github.com/adamdruppe/arsd/blob/master/postgres.d?? ?????.
????
????:
- ???? PostgreSQL? ???? ??? ???. ( ?? PostgreSQL 16??? ??????)
- IDE(Zed/ VSCode/Vim)
- DMD - d ?? ????
? ????? ???? ????? ?? ??? ?????.
- ????? ?? ????? ???.
- ????? ????? ????? ?????.
- ?? ??? ?????.
dub init <project_name>
? ??? ??? ???? ? ???? ????? ???? D ????? ?? ??? ?????.
- ?? ??? ????? ???? ?????.
- ?? - .sdl ?? .json(?? json? ??????)
- ???? ??(??)
- ?? ??
- ????(?: MIT, BSD ?)
- ??? ???
- ??? ??(?? ??)
- ??? ??? ? dub? ???? ???? ? ????? ??? ?? ??? ?????.
- dub.json: ???? ?? ??
- source/app.d: ?? ?? ??
- .gitignore: Git ?? ??
- ? ???? ????? ?????: cd
- ?? D ???? ??? ??? ? ????!
? ??? ???? ?? D ???? ??? ???? ?? ??? ?????.
Windows??? dub.json? ?? ??? ???? ???.
dub init <project_name>
??
?? ? ??? ??? ?? DLL ??? lib(?? ??) ??? ??? ?? ?? ??? ???? ????.
"libs": [ "pq" ], "lflags-windows-x86_64": [ "-LIBPATH:C:/Program Files/PostgreSQL/16/lib/" ], "copyFiles-windows-x86_64": [ "C:/Program Files/PostgreSQL/16/lib/libpq.dll", "C:/Program Files/PostgreSQL/16/bin/libintl-9.dll", "C:/Program Files/PostgreSQL/16/bin/libssl-3-x64.dll", "C:/Program Files/PostgreSQL/16/bin/libcrypto-3-x64.dll", "C:/Program Files/PostgreSQL/16/bin/libwinpthread-1.dll", "C:/Program Files/PostgreSQL/16/bin/libiconv-2.dll" ],
Linux ?? macOS??? PostgreSQL ?? ?????? ???? ?? ???? ???? ??? ???? ???. ????? ???? ??? ???? ?? ??? ???? ???? ???. ?? ?? Ubuntu ?? Debian ?? ?????? ??? ??? ? ????.
"copyFiles-windows": [ "libs/*.dll" ], "lflags-windows": [ "/LIBPATH:$PACKAGE_DIR/libs" ], "libs": [ "pq" ]
??? ?????? ???? ???? ??? ??? PostgreSQL? ????? D ???? ??? ??? ? ????.
C ??? ??:
??? D? ?? C ??????.
sudo apt-get install libpq-dev
?? D?? ??? ??? ?? ??? ? ????.
??? ? ?? ???? ?? ??? ?? ?????.
module postgres.implementation.implementationc; extern (C) { struct PGconn { } struct PGresult { } void PQfinish(PGconn*); PGconn* PQconnectdb(const char*); int PQstatus(PGconn*); // FIXME check return value const(char*) PQerrorMessage(PGconn*); char* PQresultVerboseErrorMessage(const PGresult* res, PGVerbosity verbosity, PGContextVisibility show_context); PGresult* PQexec(PGconn*, const char*); void PQclear(PGresult*); PGresult* PQprepare(PGconn*, const char* stmtName, const char* query, ulong nParams, const void* paramTypes); PGresult* PQexecPrepared(PGconn*, const char* stmtName, int nParams, const char** paramValues, const int* paramLengths, const int* paramFormats, int resultFormat); int PQresultStatus(PGresult*); // FIXME check return value int PQnfields(PGresult*); // number of fields in a result const(char*) PQfname(PGresult*, int); // name of field int PQntuples(PGresult*); // number of rows in result const(char*) PQgetvalue(PGresult*, int row, int column); size_t PQescapeString(char* to, const char* from, size_t length); enum int CONNECTION_OK = 0; enum int PGRES_COMMAND_OK = 1; enum int PGRES_TUPLES_OK = 2; enum int PGRES_FATAL_ERROR = 7; enum PGContextVisibility { PQSHOW_CONTEXT_NEVER, PQSHOW_CONTEXT_ERRORS, PQSHOW_CONTEXT_ALWAYS } enum PGVerbosity { PQERRORS_TERSE, PQERRORS_DEFAULT, PQERRORS_VERBOSE, PQERRORS_SQLSTATE } int PQgetlength(const PGresult* res, int row_number, int column_number); int PQgetisnull(const PGresult* res, int row_number, int column_number); int PQfformat(const PGresult* res, int column_number); alias Oid = int; enum BYTEAOID = 17; Oid PQftype(const PGresult* res, int column_number); char* PQescapeByteaConn(PGconn* conn, const ubyte* from, size_t from_length, size_t* to_length); char* PQunescapeBytea(const char* from, size_t* to_length); void PQfreemem(void* ptr); char* PQcmdTuples(PGresult* res); }
- PGSqlException: ?? D ?? ????? ???? ??? ?? ?? ??????. PostgreSQL ?? ??? ????? ???????.
-
??:
- ??: ?? ??? ?????
- sqlState: SQL ??? ?????
- message: ?? ???? ?????
- ???: PGconn*(PostgreSQL ??) ? ??? PGresult*(?? ??)? ?????. ??? ?? ??? ???? ?? PQresultVerboseErrorMessage ? PQerrorMessage.
- DuplicateKeyException: ?? ? ??? ???? ?? ??? ?? ??????. ??? ????? ?? ?? ?? Exception ???? ?????.
? ????? ????? ? ?? ??? ?? ??? ??? ?????
?? ?? ?? ??? ??implementation/core/core.d ??? ?????.
module postgres.implementation.exception; public: import std.conv; private import postgres.implementation.implementationc; class PGSqlException : Exception { string code; string sqlState; string message; this(PGconn* conn, PGresult* res = null) { if (res != null) { char* c = PQresultVerboseErrorMessage(res, PGVerbosity.PQERRORS_VERBOSE, PGContextVisibility .PQSHOW_CONTEXT_ALWAYS); char* s = PQresultVerboseErrorMessage(res, PGVerbosity.PQERRORS_SQLSTATE, PGContextVisibility .PQSHOW_CONTEXT_ALWAYS); string ss = to!string(c); import std.string:split; this.code = to!string(ss.split(':')[1]); this.sqlState = to!string(s); } const char* m = PQerrorMessage(conn); this.message = to!string(m); super(this.message); } } class DuplicateKeyException : Exception { this(string message) { super(message); } }
? ??? ?? ???:
-
Postgres ???: PostgreSQL ?????? ??? ?????.
- ?? ??, ??, ??? ??? ??? ?????.
- ?? ??? C ???? ???? PostgreSQL ?????? ?? ?????.
-
QueryResult ???: ?????? ?? ??? ??????.
- ?? ??? ???? ???? ?????.
- PostgreSQL?? ??? ??? ??? ??? ??? ?????.
- ?? ??: PostgreSQL ??? ?? ??? ?? ?? ??? ?????.
- ?? ??: ?? ?? ? ?? ??? ??? ?????.
- ??? ?: ???? ???? ?? ??? SQL ? ??? ?????.
- ??? ??: ???(~this())? ???? ???? ???? ?????.
- UTF-8 ??: ????? ?? ???? UTF-8? ?????.
? ??? D ??????? PostgreSQL ??????? ?? ??? ? ?? ?? ?? ?????? ???? C API? ?? ?? ?? ?? ??? ??????.
?? "?? ??? ?? ? ????"
? ?? IDE ??/??? ??? ? ????.?? ??? ??? ?????.
_internal/connection.d ??? ???? ?? ??? ?????.
dub init <project_name>
SQL? ?? ?? ? ?? ?? ??:
_internal/consts.d
"libs": [ "pq" ], "lflags-windows-x86_64": [ "-LIBPATH:C:/Program Files/PostgreSQL/16/lib/" ], "copyFiles-windows-x86_64": [ "C:/Program Files/PostgreSQL/16/lib/libpq.dll", "C:/Program Files/PostgreSQL/16/bin/libintl-9.dll", "C:/Program Files/PostgreSQL/16/bin/libssl-3-x64.dll", "C:/Program Files/PostgreSQL/16/bin/libcrypto-3-x64.dll", "C:/Program Files/PostgreSQL/16/bin/libwinpthread-1.dll", "C:/Program Files/PostgreSQL/16/bin/libiconv-2.dll" ],
?? ??? ??
D? ?? ???? ??? ??? ? ?? ??? ??? ?? ?????? ?????. ?, D?? C? ????? ? ???? ??? ???? ????.
D ???? ABC | ?? ???
D ???? ?? ??:
- ??? ?? ?? ??: ???? ??? ??? ???? ?? ???? ?????.
- ?? ??: ???? ???? ??? ???? ?? ?? ?? ??? ??? ? ????.
- Variadic ???: D? ??? ?? ???? ?? ??? ??? ?? ? ?? ???? ?????.
- ?? ifs ? ???: ?? ???? ??? ?? ??? ?? ??? ?? ? ????? ??? ?? ??(??? ??)? ??? ?? ????.
?? ??? ???? ??? ?????.
model.d
?? https://github.com/rodevasia/sequelized/blob/main/source/postgres/model.d? ??? ???? ??? ??????
??? GitHub ??? ??? ???????.
"copyFiles-windows": [ "libs/*.dll" ], "lflags-windows": [ "/LIBPATH:$PACKAGE_DIR/libs" ], "libs": [ "pq" ]
? ??? D? ??? ??? Model? ?????. ?? ?? ??? ?? ??? ??? ????.
- ?? ??: ??? postgres.model ??? ?????.
- ????: ??? ???? ?? ??? ?? D ?????? ??? ?? ??? ?????.
- ??? ???: Model ???? ?? ???? T? ?? ????? ?????. ?? ?? ???? ??? ??? ??? ? ????.
- ??? ???: ????? save(), update(), delete() ? find()? ?? ?????? ??? ?? ?? ???? ???? ????.
- ??? ?? ??: ??? D? ??? ?? ??? ???? T ??? ??? ???? ??? SQL ??? ?????.
- SQL ?? ??: getInsertQuery() ? getUpdateQuery()? ?? ???? T ??? ??? ???? SQL ??? ???? ?????.
- ?????? ?? ??: ???? ?? ??? ???? PostgreSQL ??????? ?? ?????.
??? ?? ?? ??? ??????. ??? ????? ??? ?????. ??? dub.json? ?????
dub init <project_name>
????? ??:
? ???? ???:
"libs": [ "pq" ], "lflags-windows-x86_64": [ "-LIBPATH:C:/Program Files/PostgreSQL/16/lib/" ], "copyFiles-windows-x86_64": [ "C:/Program Files/PostgreSQL/16/lib/libpq.dll", "C:/Program Files/PostgreSQL/16/bin/libintl-9.dll", "C:/Program Files/PostgreSQL/16/bin/libssl-3-x64.dll", "C:/Program Files/PostgreSQL/16/bin/libcrypto-3-x64.dll", "C:/Program Files/PostgreSQL/16/bin/libwinpthread-1.dll", "C:/Program Files/PostgreSQL/16/bin/libiconv-2.dll" ],
dub.json? ?????? ????? ??
"copyFiles-windows": [ "libs/*.dll" ], "lflags-windows": [ "/LIBPATH:$PACKAGE_DIR/libs" ], "libs": [ "pq" ]
app.d
sudo apt-get install libpq-dev
??? ???? ?? ?? ??? ???????.
???
??? ?? ?????? Sequalized ??????? ??? ??? ?????.
- std.stdio: ?? ??? ???
- postgres._internal.connection: ?????? ?? ????? ?????
- postgres.implementation.core: PostgreSQL ??? ?? ??
- postgres.model: ?????? ?? ??? ?? ?? ???? ?????
- postgres._internal.consts: ??????? ???? ?? ?? ?????
?? ??
? ??? Sequalized ?????? ???? ??? ?????.
- ?? ????? ??? DatabaseConnectionOption ??? ?????
- ??? ??? ???? Postgres ??? ??????
- Example ???? ????? ?????
- sync()? ???? ??????? ?? ???? ?????
- textField? ?? ???? ??????? ???? ?????
?? ???
? ???? ?????? ???? ??? ?????.
- ?? ???? ???? ORM ??? ?????
- id? textField?? ? ?? ??? ?????
- @Type, @PmKey ? @unique? ?? ??? ???? ?? ??? ?????
?? ??? ???? ???? ????? ???? :)
? ????? ???? ??? ??? ??? ?????.
https://github.com/rodevasia/sequelized
? ??? D? PostgreSQL ????? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

STD :: Chrono? ?? ?? ??, ?? ?? ??, ?? ?? ? ?? ?? ? ?? ?? ??? ???? C?? ???? ??? ?????. 1. std :: chrono :: system_clock :: now ()? ???? ?? ??? ?? ? ??? ?? ??? ???? ?? ? ? ??? ??? ??? ???? ?? ?? ? ????. 2. std :: Chrono :: steady_clock? ???? ?? ??? ???? ?? ??? ???? duration_cast? ?? ?? ?, ? ? ?? ??? ??????. 3. ?? (time_point) ? ?? (??)? ?? ??? ? ? ??? ?? ??? ? ?? epoch (epoch)???? ???????.

C : 1?? ?? ????? ?? ??? ?? ??? ????. Linux ????? Backtrace ? Backtrace_symbols ??? ??????. ?? ?? ? ?? ?? ??? ???? ??? ? ? -rdynamic ?? ??? ???????. 2. Windows ????? CaptUreStackBackTrace ??? ???? DBGHELP.LIB? ???? PDB ??? ???? ?? ??? ?? ???????. 3. GoogleBreakPad ?? Boost.StackTrace? ?? ?? ?????? ???? ?? ??? ? ?? ?? ??? ??????. 4. ?? ???? ?? ??? ???? ?? ???? ?? ??? ???? ?????.

C??, POD (PANDALDATA) ??? ??? ??? ?? ??? ???? C ?? ??? ??? ?????. ??? ? ?? ??? ????????. ??? ??? ?? ???? ???, ?? memcpy? ?? ?? ? ? ????. ?? ????? ?? ??? ??? ??? ? ????. ?? ?? ???? ??? ?????. ?? ? ?? ??? ??, ??? ?? ??? ?? ???, ?? ?? ?? ?? ??? ?? ? ?? ? ?? ?? ??? ?????. ?? ?? structpoint {intx; inty;}? pod???. ??? ???? ???? I/O, C ?? ???, ?? ??? ?? ?????. std :: is_pod? ?? ??? POD?? ??? ? ??? C 11 ??? std :: is_trivia? ???? ?? ????.

C?? Python Code? ????? ?? ???? ??? ? ?? ???, ?? ?? ?? ??? ???? ?? ??? ?? ? ? ????. 1. Py_Initialize ()? ?????? ????? py_finalize ()? ????. 2. pyrun_simplefile? ???? ??? ?? ?? pyrun_simplefile? ?????. 3. pyimport_importmodule? ?? ?? ?? ??, pyobject_getattrstring? ?? ??? ???? py_buildvalue? ?? ??? ???? ??? ???? ???? ??

C?? ??? ?? ??? ???? ? ?? ?? ??? ???? : ?? ??? ??, std :: ?? ? ?? ??? ? ??? ???. 1. ?? ???? ?? ???? ???? ??? ???? ?? C ?????? ????? ???? ?? ????. 2. STD :: LAMBDA ???? ?? ? ??? ?? C?? ???? ???? ??? ?? ??? ??? ???? ??-?????. 3. ??? ?? ??? ?? ???? ????? ?? ?? ?? ??? ????? ??? ??? ?? ??? ???? ? ????. ????? ???? ??? std :: ?? ?? ???? ?? ??????? ?? ???? ?? ?? ? ? ????.

anullpointerinc isaspecialValueindicating thatapointerspointtoanyvalidmorylocation, anditusiusedToSafelyManageNageanDcheckPointersbeforedEereferencing.1.Beforec 11,0ornull? WASSED, BUTNULLPTRISFREFERREDFORITYONDTYPESAFETY.SUNULLPOINTETYTETETENULUNULPENTETETETENGE

STD :: MOVE? ??? ???? ???? ?? ??? rvalue ??? ???? ????? ??? ?? ??? ??? ? ??? ?????. ?? ??, ??? ????? ? ???? ???? ???? ???? ?? ?? ??? ???? ?? ?? ?? ???? ?? ? ? ????. ?? ?? ??, ???? ?? ?? ??? ??? ?? ???? ???? ??? ?? ???? ?????? ???????. ??? ?? ????? ???? ???? ??? ????? ???, ?? ?? ??? ??? ?? ???? ????. ??? ????? ?? ? ? ??? ?? ???? ??? ?? ? ??? ??? ?? ??? ???? ?? RVO ???? ?? ??? ? ???? STD :: ??? ???? ???? ??? ? ? ????. ??? ???? ?? ???? ??? ?????? ??, ???? ??? ? ??? ??? ??? ?? ??? ?????.

?? ???? ??? ?? ??? ??? ?? ??? ????? ????. ????? ??? ?? ??? ?? ? ? (? : VirtualVoidDoSomething () = 0;), ???? ?? ?????? ??? ?? ????? ? ? ??? ???? ??? ? ??? ?? ?? ? ? ????. ?? ???? ?? ??? ?? ??? ???? ??? ?? ???? ?????. ?? ???? ?? ?? ???? ????? ?? ??? ?? ? ? ? ???? ?? ?? ???? ?? Draw () ???? ???? ? ????? ?? ?? ??? ???? ? ?????. ?? ???? ???? ?????? ??? ?????. ?? ???????? ??? ?? ??? ??, ?? ?? ???? ?? ?????? ??? ?? ??? ???? ?? ??? ???? ?? ?? ???? ?????. ?? c
