![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
npgsqlrest
Advanced tools
The npgsqlrest
is an NPM distribution of the self-contained ahead-of-time (AOT) compiled to native code executables of the NpgsqlRest Client Web App.
NpgsqlRest is an Automatic REST API for PostgreSQL Database as the .NET8 Middleware. See the GitHub Readme for more info.
NpgsqlRest Client Web App is a command line utility that runs as a configurable Kestrel web server that can:
See the default configuration file with descriptions for more information.
This package will download an executable file for the target OS on installation (see the postinstall.js script) from the GitHub release page.
Currently, only the Windows-64 and Linux-64 builds are supported.
The Mac OS builds are missing because I don't have a Mac machine. If someone could help me out with this I'd be grateful.
If you try to install this package on MacOS, or any other unsupported OS, installation will report: Unsupported OS detected: [OS Type]
.
To see how you can create your own custom build follow these instructions:
Steps:
NpgsqlRestClient
project directory.dotnet publish -r win-x64 -c Release --output [target dir]
Notes: win-x64
is the designated target OS for the build. Adjust this parameter appropriately for the target OS. See https://learn.microsoft.com/en-us/dotnet/core/rid-catalog#known-rids. The project is already configured for the AOT builds, but you will need to run the publish command from the same flavor OS as the build target OS (Windows for Windows builds, Linux for Linux builds, etc).
Install npgsqlrest
using npm:
npm install npgsqlrest --save-dev
$ npx npgsqlrest --help
Usage:
npgsqlrest Run with the optional default configuration files: appsettings.json and
appsettings.Development.json. If these file are not found, default
configuration setting is used (see
https://vb-consulting.github.io/npgsqlrest/config/).
npgsqlrest [files...] Run with the custom configuration files. All configuration files are required.
Any configuration values will override default values in order of appearance.
npgsqlrest [file1 -o file2...] Use the -o switch to mark the next configuration file as optional. The first
file after the -o switch is optional.
npgsqlrest [file1 --optional file2...] Use --optional switch to mark the next configuration file as optional. The
first file after the --optional switch is optional.
Note: Values in the later file will override the values in the previous one.
npgsqlrest [--key=value] Override the configuration with this key with a new value (case insensitive,
use : to separate sections).
npgsqlrest -v, --version Show version information.
npgsqlrest -h, --help Show command line help.
Examples:
Example: use two config files npgsqlrest appsettings.json appsettings.Development.json
Example: second config file optional npgsqlrest appsettings.json -o appsettings.Development.json
Example: override ApplicationName config npgsqlrest --applicationname=Test
Example: override Auth:CookieName config npgsqlrest --auth:cookiename=Test
npgsqlrest-config-copy
command to copy the default config to the current directory (or, optionally, directory from the first argument).$ npx npgsqlrest-config-copy
Copied appsettings.json to /home/vbilopav/npgsqlrest-npm-test/appsettings.json
$ npx npgsqlrest appsettings.json project-config.json
[11:29:06.551 INF] ----> Starting with configuration(s): ["EnvironmentVariablesConfigurationProvider", "JsonConfigurationProvider for 'appsettings.json' (Required)", "JsonConfigurationProvider for 'project-config.json' (Required)"] [Program]
[11:29:06.552 INF] Using connection: Host=127.0.0.1;Port=5432;Database=test;Username=postgres;Application Name=MyProject [Program]
[11:29:06.553 INF] Using Cookie Authentication with scheme Cookies. Cookie expires in 14 days. [Program]
[11:29:06.553 INF] Using Bearer Token Authentication with scheme BearerToken. Token expires in 1 hours and refresh token expires in 14 days. [Program]
[11:29:06.560 INF] Serving static files from /home/vbilopav/npgsqlrest-npm-test/wwwroot [Program]
[11:29:07.083 INF] Created endpoint POST /api/case-return-long-table1 [NpgsqlRest]
[11:29:07.083 INF] Created HTTP file: /home/vbilopav/npgsqlrest-npm-test/test_public.http [NpgsqlRest.HttpFiles]
[11:29:07.100 INF] Started in 00:00:00.5527040 [Program]
[11:29:07.100 INF] Listening on ["http://localhost:5001"] [Program]
See the detailed change log:
Version 2.10.0 (2024-08-06)
These two options will only apply when raw
is on. Also, comment annotation values will accept standard escape sequences such as \n
, \r
or \t
, etc.
These are:
RoutineEndpoint
option public string? RawValueSeparator { get; set; } = null;
that maps to new comment annotation separator
Defines a standard separator between raw values.
RoutineEndpoint
option public string? RawNewLineSeparator { get; set; } = null;
that maps to new comment annotation newline
Defines a standard separator between raw value columns.
In this version, when you define custom headers, either trough:
CustomRequestHeaders
option for all requests.EndpointsCreated
option event as ResponseHeaders
on a specific endpoint.Now, you can set header value from a routine parameter. For, example, if the header value has a name in curly brackets like this Content-Type: {_type}
, then a Content-Type
header will have to value of the _type
routine parameter (if the parameter exists).
See CSV example:
create function header_template_response1(_type text, _file text)
returns table(n numeric, d timestamp, b boolean, t text)
language sql
as
$$
select sub.*
from (
values
(123, '2024-01-01'::timestamp, true, 'some text'),
(456, '2024-12-31'::timestamp, false, 'another text')
)
sub (n, d, b, t)
$$;
comment on function header_template_response1(text, text) is '
raw
separator ,
newline \n
Content-Type: {_type}
Content-Disposition: attachment; filename={_file}
';
Request on this enpoint with parameters:
Will produce a download response to a 'test.csv' file with content type 'test.csv'. Raw values separator will be ,
character and row values separator will be new line.
FAQs
Automatic REST API for PostgreSQL Databases Client Build
The npm package npgsqlrest receives a total of 21 weekly downloads. As such, npgsqlrest popularity was classified as not popular.
We found that npgsqlrest demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.